0
我想知道是否有一个更简单的方法来执行一个调整大小比我在下面的代码段中写的具体方法。演员的大小调整时是否有监听器?
@Override
public void resize(int width, int height) {
stage.getViewport().update(width, height, true);
for (Table t : tabPane.tabs) {
resize(stage.getViewport().getWorldWidth(), t);
}
}
private void resize(float width, Group group) {
SnapshotArray<Actor> children = group.getChildren();
Actor[] arr = children.begin();
for (Actor a : arr) {
if (a instanceof SoundButton) {
((SoundButton) a).resized(width);
} else if (a instanceof Group) {
resize(width, (Group) a);
}
}
children.end();
}
在此先感谢。
覆盖SizeChanged将()方法 – Tenfour04
@ Tenfour04感谢那些工作得更好。也许发布它作为答案,所以我cqn标记这个问题为答案。 – Skrelp