1
votes

I have a TextButton inside a Stack and after I change its style and update its text I see no text in the Label. I even used the setText method in render(float delta) but no luck. I should mention that prior to calling the setText method the Stack also contained a picture, that completely covered the labell cell of the TextButton, which I simply removed.

Why isn't the text getting updated?

1
I'm not sure if this is successful, so I put it as a commentary, perhaps invalidate help you libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/… - Angel Angel
I tried it but it doesn't work! - gogonapel

1 Answers

0
votes

If anyone's having this issue make sure you don't have the label set to hide(). I had it hidden for when a lock picture was displayed over the TextButton. Adding the line below solved my issue:

button.getLabel().addAction(Actions.show());