【问题标题】:Understanding of andengine texture load了解andengine纹理加载
【发布时间】:2011-12-27 14:03:34
【问题描述】:

我试图从 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);
}

我在网上搜索但没有预期的解释。

【问题讨论】:

    标签: android textures andengine


    【解决方案1】:

    我不太了解 AndEngine,但这可能是因为很多库都假设图像维度是 2 的幂。

    您可以在这里找到更好的解释: About power of 2 rule.

    【讨论】:

    • 感谢 jDourlens,我不知道这条规则。 :)
    • 我知道在 PSP 上编程时这真的很难;)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-20
    相关资源
    最近更新 更多