¿Cómo hago para que el texto aparezca siempre en la parte superior (AndEngine)?

I have some text that I always need to display (like a HUD). When a sprite goes over top of it though, the sprite covers up the text. How do I always make the text on the very top layer?

preguntado el 01 de julio de 12 a las 07:07

1 Respuestas

Why you don't use HUD class? You can attach it to your camera and it will always be over all your entities attached in your regular scene. In order to achieve that you need to create an instance of HUD, attache the sprite you need to be on top of everything and use the method setHUD from the Camera.


protected Scene onCreateScene() {
    /* ... */
    HUD hud = new HUD();
    hud.attachChild("your sprite with the text goes here");
    getEngine().getCamera().setHUD(hud); //or mCamera.setHUD(hud)
    /* ... */

Respondido 01 Jul 12, 22:07

Only because I don't know how to do that. Is there an example for a HUD? - rphello101

Perfect! Thanks, that's what I needed. - rphello101

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.