0

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.

4

1 回答 1

1

我自己解决了:对于 Textfield 对象,需要再添加一行才能真正禁用输入事件:

commandText.setDisabled(true);

不知道为什么文件没有明确说明。希望它可以帮助其他人。

于 2013-12-25T21:03:06.030 回答