모든 장치의 스프라이트 크기 설정 방법은 무엇입니까? 나는 이것을 스프라이트에 사용하고있다 :모든 장치의 스프라이트 크기
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());
그러나 내가 작은 화면을 가진 장치에서 게임을 실행할 때, 스프라이트 크기는 동일하게 유지된다. 이것을 극복하는 방법?
에 대한 크기를 조정 교체 이 일에 대해 귀찮게해야합니다. – Siddharth
m이 마지막 디스플레이 사용 display = getWindowManager(). getDefaultDisplay(); \t \t CAMERA_WIDTH = display.getWidth(); \t \t CAMERA_HEIGHT = display.getHeight(); \t \t Log.e (Integer.toString (CAMERA_WIDTH), Integer.toString (CAMERA_HEIGHT)); \t \t 카메라 = 새로운 BoundCamera (0, 0, CAMERA_WIDTH, CAMERA_HEIGHT); \t \t 반환 새로운 EngineOptions (ScreenOrientation.LANDSCAPE_FIXED 사실 \t \t \t \t 새로운 RatioResolutionPolicy (CAMERA_WIDTH, CAMERA_HEIGHT), 카메라); – raj
모든 장치에서 동일한 결과를 얻으려면 800x480 또는 1024x600과 같은 디자이너의 그래픽을 개발할 때 CAMERA_WIDTH 및 CAMERA_HEIGHT를 사용하십시오. – Siddharth