我最近开始学习 LibGdx 我做了一个闪屏。它在桌面上运行得很好,但是当我尝试在 android 模拟器/模拟器或 android 手机上运行时,它无法运行。它只显示黑屏。请帮我解决这个问题。我已在此查询中附加到项目的链接。
https://docs.google.com/file/d/0B38mBPsRVO3ScU83M1dXblItS00/edit?usp=sharing
我在这里添加代码 Android 应用程序
AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
cfg.useGL20 = true;
主要 LibGdx 项目代码
public void show() {
batch = new SpriteBatch();
Texture splashTexture = new Texture("image/splash.PNG");
splash = new Sprite(splashTexture);
splash.setSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
}
public void render(float delta) {
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.begin();
splash.draw(batch);
batch.end();
}
它是简单的闪屏代码。我在网上做了研究,但没有发现任何有用的东西。请帮我解决这个问题。