【发布时间】:2013-03-18 19:25:32
【问题描述】:
有人知道为什么会这样吗?
加载图片的代码:
gameOverAtlas = new BuildableBitmapTextureAtlas(
activity.getTextureManager(), 1024, 1024,
TextureOptions.DEFAULT);
deathScreen1 = BitmapTextureAtlasTextureRegionFactory
.createFromAsset(gameOverAtlas, activity,
"deathscreen1.png");
engine.getTextureManager().loadTexture(
this.gameOverAtlas);
engine.getTextureManager().loadTexture(
this.mAutoParallaxBackgroundTexture);
engine.getTextureManager().loadTexture(
this.gameOverAtlas);
try {
this.gameTextureAtlas
.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(
0, 1, 0));
this.gameTextureAtlas.load();
this.gameOverAtlas
.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(
0, 1, 0));
this.gameOverAtlas.load();
this.playerAtlas
.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(
0, 1, 0));
this.playerAtlas.load();
} catch (final TextureAtlasBuilderException e) {
Debug.e(e);
}
}
然后附加精灵:
gameOverScreen = new Sprite(0, 0, 650, 400, ResourceManager.getInstance().deathScreen1,vbom);
attachChild(gameOverScreen);
我收到此错误:
【问题讨论】:
-
我在你的代码中看不到任何错误。你总是使用
BuildableBitmapTextureAtlas还是为什么不只使用BitmapTextureAtlas?但这不可能。之后如何加载图集(gameOverAtlas.load())?我得到像你这样扭曲的图像的唯一情况是图集没有正确加载或纹理对于图集来说太大了。但随后应用程序总是抛出异常。 -
已编辑以包括我如何加载它。
标签: android textures andengine