That blog does not exist

Game Development Community

guiAdvBarHud TGEA

by Ryan Mick · 02/18/2009 (11:10 pm) · 62 comments

This is an update to my guiAdvBarHud to the TGEA platform. What this control does is allow you to pick from several rendering modes, like:
Standard Health Bar
Image Health Bar
Generic Bar
Generic Image Bar
Arc Bar
Generic Arc Bar

All non-generic modes are tied to the health/energy values of the client. The generic modes allow you to tie it to any thing you want. The Image an Arc modes allow you to specify a texture to use for the bar. No more plain old bars. The texture can even be animated by using a DML file and up to 30 image files representing the animation. There are even script events called on frame changes so you could play a sound such as a heartbeat. In the image below two guiAdvBarHuds have been added. The first is the beer mug. The texture animation is used to make the bubbles rise to the top. The second is the semi circle wich is also using a texture animation to count from 1 to 10 in a loop. There are a lot of possibilities with this control, digital dashboards for your racing game is another example.

Download:guiAdvBarHud

www.sacdeveloper.com/portals/1/Torque/screenshot.jpg
Page «Previous 1 2 3 4 Last »
#1
02/18/2009 (11:49 pm)
nice, last week I was playing with it, started to port it. now I dont need to. thanks, its a good resource,

BTW, please could you post an example GuiBitmapCtrl() of the GenericImageBar for the playGui.gui?
#2
02/19/2009 (8:13 am)
Thanks deepscratch.

Just to be clear, are you asking for an example of using it in the GenericImageBar mode with a GuiBitmapCtrl overlay? Or are you just asking how to overlay a GuiBitmapCtrl on the control? If its the first one is there something specific you want it connected to? Something in inventory for example. Let me know what you want to accomplish and I will put something together.
#3
02/19/2009 (8:24 am)
hi Ryan

yes, I'd like to try use a GenericImageBar with a GuiBitmapCtrl overlay, basically I'd like to see how you'd lay it out.
#4
02/19/2009 (9:25 am)
Ok, that part is easy.

Start by launching tgea and go into a mission. Once in the mission press F10 to enter the GUI designer. Now follow these steps.

1. Add a GuiControl to the screen to act as a container for new controls.
a. This will make moving them around easier.
2. Size the GuiControl larger than you will need to start off.
3. Now with the GuiControl selected, right mouse click on it. There should be like a grey border around it.
4. Open the control palette and drag a guiAdvBarHud into the GuiControl. Set it's properties to your needs.
5. When you have that set up you can add the GuiBitMapCtrl to the GuiControl just like you did with the guiAdvBarHud.
6. Set it's bitmap to the bitmap you want to overlay the guiAdvBarHud.
7. Now drag the GuiBitmapCtrl over the guiAdvBarHud.
a. You may need to bring it to the front so that it actually overlays the other control.
b. You can do that by selecting in the menu Layout->Bring to Front.

That should do it, let me know if you have any questions.
#5
03/09/2009 (4:59 am)
This work in TGEA 1.8.1?
#6
03/09/2009 (7:01 am)
I haven't tested it yet, but it should work in 1.8.1.
#7
04/17/2009 (10:25 am)
I got some errors trying to build in 1.8.1,
1>../../../../../engine/source/T3D/fps/guiAdvBarHud.cpp(1142) : error C2027: use of undefined type 'ResourceManager'

Those ../'s put it up one to many directory. This could be just something that I messed up, but I'm fairly certain it was in the correct directory ("TGEA_1_8_1/engine/source/T3D/fps/guiAdvBarHud.cpp")

I'm sure this isn't the correct answer to this problem, but i was able to get it to build successfully if I put it down one more directory ("TGEA_1_8_1/engine/source/T3D/fps/customGui/guiAdvBarHud.cpp") Quick and dirty, but it seems to have worked...


PS: Forgot to thank you, this is EXACTLY what I was hoping to not have to make myself, excellent job and thanks again, this is a huge help
#8
04/17/2009 (10:37 am)
I take that back, it still doesn't build, I forgot to add it back to the project (embarrassed face).

Any ideas? Did they change something in the ResourceManager between 1.7 and 1.8

1>..\..\..\..\..enginesourceT3DfpsCustomGuiguiAdvBarHud.cpp(1142) : error C2027: use of undefined type 'ResourceManager'
1> c:\Torque\torque\engine\source\core/resource.h(67) : see declaration of 'ResourceManager'
#9
04/17/2009 (4:26 pm)
It looks like ResourceManager is now gResourceManager so that is causeing one set of problems. The other is the new implementation of the stateblock on rendering. I have to attend an event tonight but I will look into it this weekend and get an update out for 1.8. Hopefully it will be an easy update.
#10
04/20/2009 (9:43 am)
I have this working for the most part in 1.8.1. There is one issue with color when using the arcbar mode without an image. I'm hoping to resolve that tonight and then I will re-upoload.
#11
04/21/2009 (7:27 am)
Thank you so much, I really appreciate your work on this
#12
04/21/2009 (11:11 pm)
Ok, the zip now contains a 1.8.1 version. Let me know if anyone has any problems.
#13
04/22/2009 (8:03 am)
Will do, thanks again
#14
04/27/2009 (10:22 pm)
I just uploaded an update that fixes the inner radius for ArcBar modes. This means that you can now remove the center of the arc for a donught effect.
#15
06/13/2009 (2:59 pm)
very cool resource Ryan, compiled no problems. one little change to make it understand vehicle health. 2 bitmaps, one for the advbar and one for a background bitmap and works like i want it, and looks like i want it too.

thanks for sharing this resource, and thanks for the upgrade to tgea. it was exactly what i was looking for. And the uses, man lots of potential.
#16
06/14/2009 (9:11 am)
Roland, your welcome. What was the one change you made for vehicle health? I can add it to the resource for others.
#17
06/24/2009 (2:38 pm)
Ryan, this is a fantastic resource, when I opened the zip was hard to believe all the work you've put, even in the documentation! Thank you very much.

I have a question for you, regarding the use Im gonna give to it:

What I need:
I need an horizontal indicator with the zero point in the middle of it, and different colors for positive and negative values.

My idea:
My idea is as simple as put two bars toguether, but I need to define that the left bar, fills to the left, or to invert the values and colors (fill and background).

The question:
Didnt saw it on the docs, but have you used it this way, inverting the fill direction? Is there some stock option more practical than inverting the colors?


Thanks again!

Edit: Is the "fliped" member field! Awesome Work Ryan!!
#18
06/24/2009 (6:59 pm)
Yep, you found it. Glad I could be of assistance. Be sure to play with all the settings and call back events. I once had a bar set up to play a heart beat sound that synced with a pulsing health bar using the texture animations. Let me know if you have any other questions.
#19
07/23/2009 (11:29 am)
Ryan, I found a little trouble, maybe you could help me out.

As is, the GenericBar gets filled vertically or horizantally depending on the bar shape proportions.

I found however, that if the bar shape is near the change threshold, under certain screen resolutions changes (specially between different ratios) the change can happen automatically.

Would be really useful to have a field for 'locking' the bar under the current fill direction, regardless of the bar shape.

As before, I looked for a property for this, but couldn't find any. Any ideas?
#20
07/23/2009 (4:11 pm)
If I am understanding you correctly it sounds like you are letting the control auto size when the resolution changes. I don't remember which property it was that controls that but if you turn that off you should be good to go.
Page «Previous 1 2 3 4 Last »