Chase camera with sprite in andengine

ı created a racing game, and the camera monitors the car with the code below. In addition, there is a script in the scene, which is located at (100px, 100px), like a button. Problem: when the camera moves, the button never moves. The button should always be displayed on the screen. But she does not move. What can I do?

mCamera.setChaseEntity(sprite);
+3
source share
2 answers

Use a HUD. This is a special scene that does not move when the camera moves, and it was created just for this purpose. The main use is something like this:

private HUD mHUD;
mHUD = new HUD();
camera.setHUD(mHUD);
mHUD.attachChild(button);
+8
source

, , . ( ) , .

0

All Articles