哪里把我的图像forEngine在android工作室
问题描述:
它通常是可绘制的,但是当我把它们放在那里,我得到FileNotFoundException
,不应该AssetBasePath
像"drawable/"
然后纹理区域"ire.png"
,对吧?请注意,如果我忘记提及其他任何东西哪里把我的图像forEngine在android工作室
答
在您的项目模块中,找到可绘制的src
- >res
文件夹。
如果你没有得到可绘制的文件夹创建一个,并保持你的资源。
@Override
protected void onCreateResources() {
BitmapTextureAtlas mBitmapTextureAtlas = new BitmapTextureAtlas(getTextureManager(), 71, 71, TextureOptions.DEFAULT);
mBitmapTextureAtlas.load();
TextureRegion mPlayerTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(mBitmapTextureAtlas, this, "ic_launcher.png", 0, 0);
}
ic_launcher.png
在可绘制文件夹中。你
也可以把你的资源资产的文件夹,并得到这样:
@Override
protected void onCreateResources() {
ITexture backgroundTexture=new BitmapTexture(getTextureManager(), new IInputStreamOpener() {
@Override
public InputStream open() throws IOException {
return getAssets().open("gfx/background.png");
}
});
}
background.png
是存在于assets
文件夹gfx
文件夹。
我知道,但是当我编写路径时,它不起作用。我写的路径是“drawable /” –
@HeshamHaikal你应该在路径app/src/main /中创建创建'assets'文件夹并将资源放入它 – Aryan
非常感谢!顺便说一下,你知道任何最新的视频教程或网站onEngine?因为我发现的所有教程都比较旧 –