I have a weird issue that when I try to draw a Stage with only an Actor, a Label to be more precise, added to it and nothing seems to be getting drawn.

This is how my setup goes:

I have a Sprite (player) being drawn and in another class, which is the HUD, that I draw in a separate SpriteBatch, now in the same class I am trying to draw the Stage, I have ensured that the Stage is outside of the HUD's SpriteBatch.begin()/.end() calls and that the Stage is being drawn after, which should be "above" the HUD. I have also set the position, of the Actor, to be in the middle of the Stage

I just can't seem to get this to work.

This is my code for the Player class:

public void update(SpriteBatch spriteBatch, float delta){   
    // *** REMOVED FOR CLARITY ***

And this is my code for the HUD class

public void render(float delta){
    spriteBatch.draw(hudBackgroundTexture, position.x, position.y, size.x, size.y);
    // *** REMOVED FOR CLARITY ***
    labelLives.setPosition(size.x/2, size.y/2);

I'm not receiving any errors, and I know I have initialised my Stage and Label.

Thanks in advance =]]

  • \$\begingroup\$ Does your Stage draw any other actors that you add to it? If yes, then there might be a problem with the way you've initialized the Label or something. If not, then you're probably drawing something else on top of the stage. \$\endgroup\$ – VictorB Mar 11 '14 at 21:38
  • \$\begingroup\$ I figured out what the problem was, something very stupid xD \$\endgroup\$ – user959631 Mar 11 '14 at 22:44

Haha, well, I found out what was up, it was my font file, you see when I was editing it, I used the text READY, so when I saved it, I didn't know that the text written is what is saved, so when I looked at the font.png file, I found that it only contained the letters ADERY.

Thanks for the help anyway =]


Not the answer you're looking for? Browse other questions tagged or ask your own question.