سؤال

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.

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top