Andengineのカメラの背景を中央に配置するための式がありますか?Andengineシーンの背景を中央に配置する方法
私のカメラは、私はこれを使用して取得する特定のデバイス上の画面の大きさ...私SpriteBackgroundについては
final Display display = getWindowManager().getDefaultDisplay();
CAMERA_WIDTH = display.getWidth();
CAMERA_HEIGHT = display.getHeight();
int x = //formula to center background in camera or screen on the X axis
int y = //formula to center background in camera or screen on the Y axis
で、どのように私は、xが何であるかを見つけ出すことができ、そしてyは、それを中心にカメラで?
xおよびyは、このように供給され、..
Sprite sprite = new Sprite(x,y,TextureRegion);
スプライトとは何ですか?それが取るパラメータは何ですか? –
それは私の質問Sprite sprite = new Sprite(int、int TextureRegion);画面の高さと幅を使ってシーン内でXとYを中心にするだけでいいです。 –
私はint intを意味しましたか?上と左? –