Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: geork on Fri 14/05/2010 22:37:12

Title: GUI arrays and it's label arrays question
Post by: geork on Fri 14/05/2010 22:37:12
 Hey all!
  Just wondering whether it is possible to find a label from a GUI by it's ID. I know that all labels have an ID relative to the GUI, but that all GUI's  hav a unique ID. So I'm looking for something along the lines of:

  gui[number1].Label[number2] = stringValue;
 

  obviously, it's not that easy, but is there a way of doing this sort of thing?
   Thanks
Title: Re: GUI arrays and it's label arrays question
Post by: GarageGothic on Fri 14/05/2010 23:15:11
I think this should work:

Label* mylabel = gui[number1].Controls[number2].AsLabel;
if (mylabel != null) mylabel.Text = stringValue;

Title: Re: GUI arrays and it's label arrays question
Post by: geork on Fri 14/05/2010 23:46:27
 Thanks, it works perfectly! ;D