如何为所有设备设置 Sprite 大小?我将其用于 Sprite :
final Display display = getWindowManager().getDefaultDisplay();
CAMERA_WIDTH = display.getWidth();
CAMERA_HEIGHT = display.getHeight();
Log.e(Integer.toString(CAMERA_WIDTH), Integer.toString(CAMERA_HEIGHT));
camera = new BoundCamera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
return new EngineOptions(true, ScreenOrientation.LANDSCAPE_FIXED,
new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), camera);
facebook = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
this.mBitmapTextureAtlas, this, "facebook.png", 0, 0);
mHardware1[active] = new Sprite(pX, pY, facebook,
this.getVertexBufferObjectManager());
但是当我在屏幕较小的设备上运行游戏时, Sprite 大小保持不变。如何克服这个问题?
最佳答案
尝试在 Sprite 大小上使用“dp”单位。如果您使用“px”,它将无法在其他设备上缩放。
请阅读this link了解更多详情:)
关于java - 所有设备的 Sprite 大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16890728/