I implemented a loot/money system using text with LibGDX. It displays how much money you have in the HUD.
The problem: The rendering of the money value does not move smoothly with the camera. Basically, it retains it’s int position, and not it’s float position. This is bad because it follows the camera and player and supposed to be rendered according to where the player is in the world. This makes the money display kind of just shoot over constantly when the player hits a new tile.
The player moves on the x, y axis with float values, which is how the “money display” is set up (so the x and y positions are floats, not ints). However, it does not move smoothly…the money display wont move until the player gets to a certain int (not float). So if the player is moving from tile one to tile two, and it takes him 10 frames to do this smoothly, the money display will retain it’s original position at tile one, and when the player hits tile two, the money display will shoot over to the correct position at tile two, but disregard the movement between tile one and two.
I can upload a video of this after work if it doesn’t make sense.
But my main question is, should I even be using the draw text method in LibGDX for a game that moves around a lot? Or should I have images (which do move correctly with the camera and player). How do you guys display text, and if you use the drawing text method in LibGDX, how do you make it have smooth movement? (I already googled and looked on here but didn’t really find a nice solution).