Game Development Community

GUI question

by Jeffrey Olijar · in TGB Platformer Kit · 04/14/2011 (4:41 pm) · 1 replies

Ok I have been playing with Torque Builder with the platform add on for a few days. I really like how simple it is to setup levels and animations but I have a question that I haven't been able to find answers to either through the documentation or tutorials.

I figured out how to remove the demo gui and I want to replace it with a vertical health bar that scales depending on the amount of health remaining. I am not really sure how to go about doing this. If anyone could point me in the right direction I would appreciate it.

#1
06/03/2011 (8:42 am)
You can see the code for Health within Playermethods.cs, all they're doing pretty much is when health gets a certain value it's making the health representation turn invisible.

So if you had 10 pieces of health, which make up one long bar.
Health1
Health2
Health3
...
Health10

You'd so something like, if (%this.health < 10) Health10.visible = false.

Kinda simple.