views:

14

answers:

1

now i need to add a health bar and countdown timer on the screen.

how am i going to do it? adding a plane in the 3d scene? the health bar is always on the top right corner of the screen. is there anyway of NOT using 3d concept to implement this. i mean i could do it with a plane keep changing it's texture to show the status of the character. is there any cleaner way of doing it?

thanks in advance!

A: 

I don't see why you should have any problem simply adding your UI elements to the root of the display list. I don't believe papervision takes complete control of the display, IIRC it looks like this:

        [put your text fields, health bars etc. here]   A (higher)
       /                                                |
ROOT -                                                z-depth
       \                                                |
        PV3D context                                    V (lower)

Because obviously, the root can have as many DisplayObject children as you like, aside from PV3D's own container. So after the code where you set up PV3d and it gets added to the display, just add a new DisplayObject containing your healthbar. Then swap the depth indices of the two so that your UI DisplayObject appears in front of the PV3D object.

DISCLAIMER: This is all from memory, it's been a year since I last used good old AS3.

Nick Wiggill