Game Development Community

Best way of doing this?

by James Laker (BurNinG) · in Torque Game Engine · 07/17/2008 (2:07 am) · 6 replies

Hey everyone.

I wasn't happy with the old targetting hud, so I decided I want something different. My girlfriend came up with this:
burningza.googlepages.com/SBtargetting.jpg
So the left (green) bar will be the enemy's armor, while the right (white) bar, will be it's energy. What would be the best way to get that effect?

The only way I can think of is by having lots of images - 22 for Armor and 22 for Energy (if you count the arrows)

Surely there must be a more effective way. Can anyone please shed some light here.

Thanx

#1
07/17/2008 (7:41 am)
What about making one image for white and one for green, both full circles with half the arrows lit.
With the green, rotate it so the proper number of lit bars show on the left side, then mask out the right so it doesn't show. Do the opposite for the white.
#2
07/17/2008 (9:55 am)
I found a resource a while back that renders arcs in the GUI. Its only for TGE, as it makes changes to the DGL layer, but it you are up for the porting work I think it will suit your needs. Here is the link.

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=14183
#3
07/18/2008 (12:24 am)
Might be a stupid question, but how do I mask out an area of an image?

Good find Taylor... Thanx, will have a look at it.
#4
07/18/2008 (6:49 am)
If you want part of the image to be invisble, you can use alpha channel transparency.
#5
07/18/2008 (8:56 am)
Make the green side and the white side each a separate animatedSprite with one frame for each level of fullness.

Unless you are up for source changes thats the only way I know of.
#6
07/21/2008 (12:06 am)
Somehow I dont think Alpha Channel transparency will work, since I will need to rotate the Alpha Channel? Isn't there a way I can have a mask texture that I rotate?

I have no idea how to do masking in TGE(A)... Any other helpful links or code snippits?