How to display a GI value on a label?

Started by , Sun 13/08/2006 15:54:01

Previous topic - Next topic

RobinMasters

How can I display the value of a GlobalInt on a label?
For exampel the GI 7 on label "lblPoints"

GarageGothic

Code: ags
String labeltext = String.Format("%d", GetGlobalInt(7));
lblPoints.Text = labeltext;


RobinMasters

I entered
Quote
  // script for Room: Player enters room (before fadein)

String labeltext = String.Format("%d",GetGlobalInt(7));
nigeriaSpTore.Text = labeltext;

SetGlobalInt(7,5);

but the value remains 0

TheMagician

I would say you have to set the GlobalInt before you update the label string.

Everytime you change the value of the GlobalInt you have to update your label accordingly.

FSi++

Or put this in repeatedly_execute():
Code: ags

String labeltext = String.Format("%d",GetGlobalInt(7));
nigeriaSpTore.Text = labeltext;


So it will be updated automagically

RobinMasters

Thanks

I've set an array instead of a GI, but  how can I add 3 Points? (not set 3 Points)

Quote
  // script for Hotspot 1 (Hotspot 1): click at hotspot
 
Punkte[0] = 3;

GarageGothic


strazer

Quote from: GarageGothic on Sun 13/08/2006 16:23:45
Code: ags
String labeltext = String.Format("%d", GetGlobalInt(7));
lblPoints.Text = labeltext;


Or just
  lblPoints.Text = String.Format("%d", GetGlobalInt(7));

;)

SMF spam blocked by CleanTalk