Hi there,
I have been thinking of this for a while in my head and am attempting to fulfill it, however I am having trouble. Here is what I am looking for:
Setup: You know whenever you collect a coin… or a gem, or maybe just gain some XP, a little text pops up that says something like “+1”, or “+50”? That is what I’m attempting to visually achieve.
However, I want to be able to simplify it by creating a method for it in an FX class. So that it could be called using something like “text(”+50", x, y) and be drawn correctly in the sprite batch. The attempt I just made failed. What I tried was:
Play Screen (Play), FX CLass (FX).
(Play)
render method..
game.sb.begin();
fx.text("Hello", 50, 50);
game.sb.end();
(FX)
text method
text(String text, i, ii){
fontX = i;
fontY = ii;
//Create TTF Font
font.draw(game.sb, fontX, fontY);
(All using the same spritebatch from main class)
Hopefully this makes sense. Please help me out.
Thanks - A