Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Valentine on Sat 31/01/2009 21:07:05

Title: Set Label Text by ID Number?
Post by: Valentine on Sat 31/01/2009 21:07:05
Hi, I want to have some text that alternates between different labels, so to do this easily, I need to use the ID number of the label. However, I'm having trouble setting the text by using the ID number.

I know normally, I would use; MyFirstLabel.Text="Here is some text!";

But using the ID number, I've tried;

Label.0.Text="Here is some text!";
Label[0].Text="Here is some text!";
Label(0).Text="Here is some text!";

Is there a way to make this work? Thanks!
Title: Re: Set Label Text by ID Number?
Post by: Khris on Sun 01/02/2009 00:01:39
Use the GUI's Controls array:
gGUI.Controls[0].Text = "...";