对andengine纹理负载的理解
我试图理解下面来自 andengine 的代码来加载纹理,我想知道什么是 512 n 512(我知道它的高度和宽度),但是尺寸为 480 * 320 的图像。
public void onLoadResources() {
this.mTexture = new Texture(512, 512,
TextureOptions.BILINEAR_PREMULTIPLYALPHA);
this.mSplashTextureRegion = TextureRegionFactory
.createFromAsset(this.mTexture,this, "image.png", 0, 0);
this.mEngine.getTextureManager().loadTexture(this.mTexture);
}
我在网上搜索但没有预期的解释。
I am trying to understand below code from andengine to load the texture, i would like to know what is 512 n 512(i know its height and width), but the image of size 480 * 320.
public void onLoadResources() {
this.mTexture = new Texture(512, 512,
TextureOptions.BILINEAR_PREMULTIPLYALPHA);
this.mSplashTextureRegion = TextureRegionFactory
.createFromAsset(this.mTexture,this, "image.png", 0, 0);
this.mEngine.getTextureManager().loadTexture(this.mTexture);
}
I searched on the net but no expected explanation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不太了解 AndEngine,但这可能是因为很多库都假设图像尺寸是 2 的幂。
在这里你可以找到更好的解释:
关于 2 的幂规则。
I don't know well AndEngine but this might be because a lot of libs assume that images dimension are power of two.
Here you can find a better explanation:
About power of 2 rule.