andengine 中的微不足道的纹理加载
在 andngine 中,我使用以下行代码定义了一个纹理:
private Texture mTexture;
这是我的 onLoadResource 函数:
public void onLoadResources() {
this.mTexture = new Texture(64, 64,
TextureOptions.BILINEAR_PREMULTIPLYALPHA);
}
但是此代码给出了错误,因为“import org.anddev.andengine.opengl.texture.Texture”类中唯一的构造函数具有以下签名:
public Texture(final PixelFormat pPixelFormat, final TextureOptions pTextureOptions, final ITextureStateListener pTextureStateListener);
你能帮我做什么吗?大多数教程都使用这样的内容:
new Texture(64, 64,
TextureOptions.BILINEAR_PREMULTIPLYALPHA);
但我的,不起作用。我们将不胜感激您的帮助。
问候。
In andngine , I defined a texture, using the following line code:
private Texture mTexture;
And here is my onLoadResource function:
public void onLoadResources() {
this.mTexture = new Texture(64, 64,
TextureOptions.BILINEAR_PREMULTIPLYALPHA);
}
but this code gives an error, because the only constructor in "import org.anddev.andengine.opengl.texture.Texture" class has the following signature:
public Texture(final PixelFormat pPixelFormat, final TextureOptions pTextureOptions, final ITextureStateListener pTextureStateListener);
Would you please help me what to do? Most tutorials, used something like this:
new Texture(64, 64,
TextureOptions.BILINEAR_PREMULTIPLYALPHA);
But mine, does not work. Your help would be appreciated.
Regards.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
几个月前,原始
Texture
类的大量功能似乎已移至BitmapTextureAtlas
。您应该能够调用具有相同宽度、高度和TextureOptions
参数的构造函数 - 或您喜欢的任何其他变体。这个早期问题中还有一个代码示例。
It appears that a few months ago a bunch of the functionality of the original
Texture
class was moved toBitmapTextureAtlas
. You should be able to call the constructor of that with the same width, height andTextureOptions
parameters - or any of the other variants of your liking.There's also a code example in this earlier question.