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