libGDX:根据演员的名字从舞台中获取标签



我的演员是Label。当我通过名称获得它时,我没有找到setText(...);方法。

我用了:

stage.getRoot().findActor("name"). // setText not exist

如何找到Label演员

在使用

之前可能需要转换为Label:
Label labelActor = (Label) stage.getRoot().findActor("name");
labelActor.setText("abc");

最新更新