简体   繁体   English

AndEngine将精灵显示为白色矩形?

[英]AndEngine shows sprite as a white rectangle?

when I try to add a sprite to my scene (in AndEngine) and run the app in my phone, it shows only a big rectangle. 当我尝试向我的场景添加一个精灵(在AndEngine中)并在我的手机中运行应用程序时,它只显示一个大矩形。 My code is: 我的代码是:

myTex = new BitmapTextureAtlas(512, 512, TextureOptions.DEFAULT);
myTexRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(myTex, this, "menu_spr.jpg", 0, 0);

My image's dimensions are 424*424. 我的图片尺寸为424 * 424。 And I tried using both of TextureOptions.DEFAULT and TextureOptions.BILINEAR . 我尝试使用TextureOptions.DEFAULTTextureOptions.BILINEAR Is my image damned? 我的形象被诅咒了吗? Thanks. 谢谢。

you don't say which version of AndEngine you are using, and you don't show all your code ... are you loading the TextureAtlas? 你没有说你正在使用哪个版本的AndEngine,而且你没有显示你的所有代码...你在加载TextureAtlas吗? Something like 就像是

myTexRegion.load();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM