Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Synthetique on Sun 27/07/2003 15:32:33

Title: GUI text problem, int to gui text.
Post by: Synthetique on Sun 27/07/2003 15:32:33
I want a gui to display the health.
I tried:
SetTextBoxText(3, 0, "Health: %d", health);

but it said "error: undefined symbol" when i tried to save..
what to do?
Title: Re:GUI text problem, int to gui text.
Post by: MachineElf on Sun 27/07/2003 18:05:05
You'll have to do something like this:

StrFormat (buffer,"Health: %d",health);
SetLabelText (3,0,buffer);

SetLabelText only has those 3 parameters.
Title: Re:GUI text problem, int to gui text.
Post by: Pumaman on Sun 27/07/2003 18:06:56
SetTextBoxText doesn't support %d-style stuff. You need to do:

string temp;
StrFormat(temp, "Health: %d", health);
SetTextBoxText(3, 0, temp);


Edit: eek, pipped to the post by Vargtass :)
Title: Re:GUI text problem, int to gui text.
Post by: Synthetique on Sun 27/07/2003 18:17:20
ah thank you!! :)