how to add HP/MP bars as billboard

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

how to add HP/MP bars as billboard

Post by keless »

I want to add a billboarded 'bar' as a child of a scene node.

right now I see example code of how to create one billboard image, but I want multiple images that are goin to be dynamic. Is it possible to create an empty billboard node, and attach what I guess would be a custom scene node as a child to that?

technically, this isnt the right way to do it, as it should be apart of the 2D just mapped to a 3D space. But I want to do it this way first to see how I would map dynamic billboards to avatars.
a screen cap is worth 0x100000 DWORDS
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

I would create a general child scene node which can contain a GUIElement. Would be cool, in this way you could not only add things like icons, and healthbars to the avatar, but also Text, single and multiline. You could let it draw itself at the 2d position you get from ISceneCollisionManager::getScreenCoordinatesFrom3DPosition for example.
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

I am creating a class "CSN_Overlay" which accepts a GUIElement* in its constructor.

when it's render function is called, it merely updates the 2D position of the GUIElement. This can be any Element, including static text/image/your custom element.

This means I can also write a robust "Progressbar" type GUI element, which I will attach to an overlay to create the HP bar.

Check out the ss_overlayX screen shots:
http://www.skyesurfer.net/keless/IrrLic ... reenshots/
(the Overlay is not transparent because I didnt bother to set the transparency color of the IImage element before taking this picture.)
a screen cap is worth 0x100000 DWORDS
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

Apparently IGUIImage does not support drawing its Texture as transparent. This should be addressed by Niko. (a simple boolean with get and set functions should do)
a screen cap is worth 0x100000 DWORDS
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

keless wrote:Apparently IGUIImage does not support drawing its Texture as transparent. This should be addressed by Niko.
Yep, right, already on my list.
Post Reply