Possible for 2D graphics on top of 3D?

Hey all



I’m trying to draw 2D graphics in SimpleApplication. I have a 3D world but I want some 2D graphics on top of that. For example, a lifebar above my head or some extra text in the canvas.



How can I achieve this? I added the canvas on a JPanel, so I already tried to override the paintComponent(Graphics g) of a JPanel but it doesn’t work.



It would be highly appreciated of someone could help me with this.





Grtzz

A simple health bar could consist of two quads(red and green) that you scale according to the health of the character. Attach it to your character node, together with a BillboardControl to make it face the camera. The same procedure can be used to attach Bitmap text.



Using swing is not really recommended (i’ve used some elements on top of the canvas, and they don’t work well).

1 Like