【问题标题】:Problem to load large background image in device (Andengine)在设备中加载大背景图像的问题(Andengine)
【发布时间】:2011-07-25 08:52:54
【问题描述】:

加载设备时只显示白色图像,加载模拟器时图像损坏

示例代码:

// this.mCamera = new Camera(0, 0, 480,320);

    final Engine engine = new Engine(new EngineOptions(true, 

ScreenOrientation.LANDSCAPE, new FillResolutionPolicy(), this.mCamera));

this.mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);

    final Engine engine = new Engine(new EngineOptions(true, 

ScreenOrientation.LANDSCAPE, new FillResolutionPolicy(), this.mCamera));

//----

this.mTexture = new Texture(2048, 512, TextureOptions.BILINEAR_PREMULTIPLYALPHA); this.mbgTextureRegion = TextureRegionFactory.createFromAsset(this.mTexture, this, "gfx/bg.png", 0, 0);

        this.mEngine.getTextureManager().loadTexture(this.mTexture);

andengine 中将使用的最大纹理大小是多少。我用的是 2048 ,它的问题,请帮助?

【问题讨论】:

    标签: android andengine


    【解决方案1】:

    最大纹理大小取决于设备。 只有较新的设备支持 2048x2048。根据我的经验,截至今天,1024x1024 得到了更好的支持。

    也可以在运行时找到最大尺寸: How can I find the maximum texture size for different phones?

    【讨论】:

      猜你喜欢
      • 2017-02-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-04
      • 2021-01-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多