Question

In document ( https://code.google.com/p/libgdx/wiki/scene2d ) it states that:

If setVisible(false) is called on an actor, its draw method will not be called. It will also not receive input events.

And my code is:

tableTopInfo.setVisible(false);
tableConsole.setVisible(false);
commandText.setVisible(false);
currentPosition.setVisible(false);

where 2 table objects added commandText and currentPosition. It does not draw the objects correctly but the textfield commandText still receives the event and stores the inputs into the textfield.

Thanks.

Était-ce utile?

La solution

I solved it by myself: for Textfield object, it is needed to add one more line to really disable the input event:

commandText.setDisabled(true);

Not sure why the document does not state it clearly. Hope it helps other people.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top