Change Text on GUI Label with a Button

Started by Bleckman1974, Mon 21/11/2005 17:53:45

Previous topic - Next topic

Bleckman1974

Ok, I have GUI:

It has two separate Dials

one Changes one GUI label, the other changes the other GUI label

like "blah blah"
      "xxxxxxxx"
      "jjjjjjjjjjjjjjj"
on one
and the other has diferent "lables"

i went to change each one with the dials
I've tried "SetLablelText" and it won't work
I'm using AGS 2.71 RC3
Narcolepsy (BACK IN PRODUCTION)
Story (50%)
Graphics (5%)
Puzzles(20%)
Programming(15%)

Still Reading Commercial Emails For Free?
Receive Emails On Topics That Interests You
And Get Paid For It! Get $10 Just to signup!
http://hits4pay.com/members/index.cgi?bleckman1974

Ashen

This should probably be in Beginners Tech, as the answer is in the manual. Looking up SetLabelText will get you:

Quote
Text property (label)
(Formerly known as SetLabelText, which is now obsolete)
(Formerly known as Label.GetText, which is now obsolete)
(Formerly known as Label.SetText, which is now obsolete)

String Label.Text;

Gets/sets the text displayed in the specified label. This allows you to change the text during the game, for example to create a Lucasarts-style status line.

So:
Code: ags

myLabel.Text = "blah blah";



The rest (the 'different labels for different values' bit) is all about variables - which are probably in the manual and certainly in the BFAQ.
I know what you're thinking ... Don't think that.

Bleckman1974

SetLabelText Is oblsolete, yes I am aware of that.

i Read the manual

that's why i asked for Help.

those commands are obsolete

I searched and evey post used the OLD AGS commands

Narcolepsy (BACK IN PRODUCTION)
Story (50%)
Graphics (5%)
Puzzles(20%)
Programming(15%)

Still Reading Commercial Emails For Free?
Receive Emails On Topics That Interests You
And Get Paid For It! Get $10 Just to signup!
http://hits4pay.com/members/index.cgi?bleckman1974

Ashen

#3
That quote is from the manual and shows the right thing to use to change a label's text - the String Label.Text property. If you go to that entry, or look at the code I gave you, you'll see the correct way to use it.

My point was, if you look up SetLabelText you will be linked to that entry - which tells you that Label.Text has replaced the 3 obsolete (as of 2.71) commands SetLabelText, Label.GetText and Label.SetText.

And yes, most posts will use older AGS codes, because 2.71 is still in beta, so not as many people use it.
I know what you're thinking ... Don't think that.

Bleckman1974

OK I Got it, i understand it now

I just tend to OVER-THINK thinks and mak them more Diffucult then what they realy are, AGS's Script Language is so easy even a caveman could do it LOL.

Narcolepsy (BACK IN PRODUCTION)
Story (50%)
Graphics (5%)
Puzzles(20%)
Programming(15%)

Still Reading Commercial Emails For Free?
Receive Emails On Topics That Interests You
And Get Paid For It! Get $10 Just to signup!
http://hits4pay.com/members/index.cgi?bleckman1974

SMF spam blocked by CleanTalk