背景テクスチャがあり、それを別の背景テクスチャに変更したいと考えています。背景テクスチャに関するいくつかのサンプルを読んでテストしましたが、2 番目の背景が表示されません。
これは私が変更しようとした最後のコードです...誰か助けてくれますか? ありがとう
Scene scene1 = new Scene();
ITexture backgroundTexture1 = null;
try {
backgroundTexture1 = new BitmapTexture(this.getTextureManager(), new IInputStreamOpener() {
@Override
public InputStream open() throws IOException {
return getAssets().open("gfx/crackedscreen.png");
}
});
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
backgroundTexture1.load();
this.mBackgroundTextureRegion1 = TextureRegionFactory.extractFromTexture(backgroundTexture1);
Sprite backgroundSprite = new Sprite(0, 0, this.mBackgroundTextureRegion1, getVertexBufferObjectManager());
scene1.attachChild(backgroundSprite);
scene1.setBackgroundEnabled(true);
return scene1;