How to incorporate text and global values in the same text

For questions about using Classic.

Post » Mon Feb 18, 2008 5:03 pm

I'm trying to make a text box with two values in it - a current score and the high score. I want it to read "Score: 0/0" with the current score on the the left and the high on the right. Text boxes don't seem to want to take both strings and values at the same time, though. I tried with multiple text boxes, one for each part, but then there's a formatting issue because I don't know how to check how long the numbers are, and everything isn't placed correctly. Thoughts?
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Mon Feb 18, 2008 6:06 pm

Use str() to convert numbers to strings, or use the & operator which converts anything which isn't a string to a string. Eg.:

"Score: " & currentscore & "/" & highscore
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Mon Feb 18, 2008 6:29 pm

yeah, i also had problems with this at first as well :P
B
2
S
2
G
5
Posts: 293
Reputation: 2,236

Post » Mon Feb 18, 2008 7:40 pm

Thanks, that worked great! :)
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests