Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Rd27 on Wed 21/03/2007 19:47:14

Title: Displaying health in gui
Post by: Rd27 on Wed 21/03/2007 19:47:14
I would like to make a healthpoint system in my game, which would display health in a gui.
Like setting in the game_start script: Set globalint(1,10);
Then there should be gui, what is showing Health: 10/10.

How would I do this???

I have made many many searches, tried to look tutorials and I have founded numerous topics and few tutorials, but I just haven't got it work ???.

All the help are welcome  :).
Title: Re: Displaying health in gui
Post by: Khris on Wed 21/03/2007 21:07:19
Put a label on the GUI, set its Scriptname to e.g. "lblHealth".

Then put this in the rep_ex:
  lblHealth.Text=String.Format("%d/10", GetGlobalInt(1));

If this doesn't solve it, PLEASE tell us exactly what does or doesn't happen and what you've tried so far.

Edit by Ashen: For attitude
Title: Re: Displaying health in gui
Post by: Rd27 on Thu 22/03/2007 12:47:00
That worked perfectly!

Thanks a lot  :)!