我正在使用libgdx开发一款Android游戏,想知道如何创建Android UI元素,比如EditText和Button。我知道这只能在Android上运行,所以我会像这样做:
if (Gdx.app.getType() == Application.ApplicationType.Android ) {
...
}
我发现scene2d.ui可能会有帮助,但我不使用scene2d(演员、舞台等)并且不太熟悉它。而是使用类似于这样的Screen:
public class GameScreen implements Screen {
...
}
我曾在使用libgdx编写的游戏原型保卫中看到过这种可能性。