How do you set text to a global variable?

For questions about using Classic.

Post » Mon Jan 16, 2012 5:04 pm

I am new to construct and i want to know how to set text to a global variable.
For example:
1. I have a text box and global variable "score"
2. I go to the event sheet, click the text box, and then click set text

And then i don't know what to type into the box to have the text box show the global variable.
B
9
S
3
G
1
Posts: 10
Reputation: 710

Post » Mon Jan 16, 2012 5:20 pm

Hi.

Use: global('score')

It would probably be useful for you to look at the Example and Tutorials post that has many good examples. Find it HERE.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,846
Reputation: 48,293

Post » Mon Jan 16, 2012 6:48 pm

str(global('score'))

Convert to stringUrled2012-01-16 18:48:28
B
18
S
4
G
1
Posts: 413
Reputation: 2,512

Post » Mon Jan 16, 2012 6:53 pm

Here it a .cap.
I hope it is helpful. :)
http://dl.dropbox.com/u/56653097/Games/Global%20Text%20Score.cap
B
5
Posts: 18
Reputation: 386

Post » Mon Jan 16, 2012 7:21 pm

It can be so easy: Set Text: "Score: " & score

That's it!Weishaupt2012-01-16 19:21:22
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Mon Jan 16, 2012 7:23 pm

@Weishaupt

That would only work in C2.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
120
S
28
G
68
Posts: 4,846
Reputation: 48,293

Post » Mon Jan 16, 2012 7:27 pm

oh sorry - my bad - did not realize that this is the classic board
B
42
S
19
G
12
Posts: 723
Reputation: 13,911


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests