我正在使用Starling构建应用程序并导入了脚手架项目但是每当我调用getTextureAtlas()时它都没有显示图像
this.mLogo = new Image(Assets.getAtlasTexture("powered_by_starling"));
this.mLogo.x = 0;
this.mLogo.y = 0;
this.addChild(this.mLogo);
没有错误所以我猜它可以找到纹理。如果我将名称更改为不存在的名称,则会抛出错误'texture not not null'。我也在使用
Assets.contentScaleFactor = Starling.current.contentScaleFactor;
并且所有内容都是脚手架的标准导入,但我使用的是Feathers UI屏幕导航器,但我没有在其他项目上出现空白图像问题。
编辑:我似乎无法让sprite在扩展羽毛的类中工作.strols.Screen
答案 0 :(得分:0)
getAtlasTexture是你写的一个函数吗?你在使用starlings资产经理吗?如果是这种情况,您将需要该类的实例,而不是静态方法调用。
无论如何,尝试使用Texture类及其提供的静态方法。你不需要用于图像的图册(精灵表) - 但是对于MovieClip你需要它。
Texture.fromBitmap
Texture.fromBitmapData
......和其他人,检查文件
如果你的图形是嵌入的,那么使用它:
var _img:Image = new Image(Texture.fromBitmap(new Assets.EmbeddedGraphic()));
答案 1 :(得分:0)
你在使用atf吗?因为同样的事情发生在我身上,直到我使用了png然后才有效