对andengine纹理负载的理解

发布于 2024-12-23 01:41:08 字数 454 浏览 1 评论 0原文

我试图理解下面来自 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

好菇凉咱不稀罕他 2024-12-30 01:41:08

我不太了解 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文