2012-07-16 69 views
0

我必須在我的項目中使用大紋理,所以我不能把所有的紋理放入一個BitmapTextureAtlas。我試圖把它們分成兩個地圖集:如何在AndEngine中使用兩個BitmapTextureAtlases?

textureAtlas = new BitmapTextureAtlas(2048, 2048, TextureOptions.BILINEAR_PREMULTIPLYALPHA); 
textureAtlas2 = new BitmapTextureAtlas(1024, 2048, TextureOptions.BILINEAR_PREMULTIPLYALPHA); 
foo = BitmapTextureAtlasTextureRegionFactory.createFromAsset(textureAtlas ,this,"foo.png",0,0); 
bar = BitmapTextureAtlasTextureRegionFactory.createFromAsset(textureAtlas2,this,"bar.png",0,0); 

但是當我嘗試使用bar

Sprite sBar = new Sprite(0,0,bar); 
scene.attachChild(sBar); 

我能看到的唯一的事情是白色矩形,而不是我的形象。我不知道這裏有什麼問題。

回答

1

好的,我明白了。我只是忘了這個:

getEngine().getTextureManager().loadTexture(textureAtlas2);