Show variable values in a custom GUI

Started by JpGames, Fri 30/03/2007 23:03:22

Previous topic - Next topic

JpGames

I want know if i can show the value of one variable (for example, graphicalvariable("one")) in my custom GUI. I tryed with %d. , @ in the labels and it do not work. I look for some relaten threads in the past but i do not find nothing usefull. I tried with this script in the repeteadly_execute:

   int TotalDisparos = GetGraphicalVariable("disparos");
   String lblDisparos;
   lblDisparos.Text = String.Format("Disparos: %d", TotalDisparos);

And then i write @lblDisparos in the text message of the label but it do not works neither. It give the error message: 'Text' is not a public member of 'string'. I erased text, but the GHI is only showing "@lblDisparos"  ???

Thanks again for your patience

JpGames

EDIT I were looking for hours and i found 3 or 4 threads about how to show variables in a custom GUI, but some ones are very old (2004) Anyway, all them speak about lblXXX.Text, but it give me an error (text is not a public member of string) Must i declare lblXXX first? Im becoming crazy trying to solve this  ::)

Pumaman

Quote from: JpGames on Fri 30/03/2007 23:03:22
   int TotalDisparos = GetGraphicalVariable("disparos");
   String lblDisparos;
   lblDisparos.Text = String.Format("Disparos: %d", TotalDisparos);

Remove the "String lblDisparos;" line, and make sure that the GUI Label that you want to dispaly the text on has its Script Name set to "lblDisparos".

JpGames

Im so stupid sometimes. I did not look at that before; my label name were "new label"  :-X I did exactly what you said and now is working perfect  ;D

Thanks again, this forum is helping me a lot to improve with the AGS very quickly.

JpGames

SMF spam blocked by CleanTalk