Moving Digits & Text

For questions about using Classic.

Post » Fri Dec 23, 2011 2:56 pm

In my GUI, the word "Score" and the digits for it to the right:

+ System: Always (every tick)
-> Health: Set text to "Health: " & Hero ('Health')
-> Score: Set text to "Score: " & Score ('score')
-> System: Set global variable 'Score' to Score ('score')

What I have tried doing is making the digits to the left of the word "score." I have tried adding spaces, using quotes, mixing and matching. I either get errors or I get to the closest possible where the digits is to the left but no spaces: 0Score

How do I get the spaces in correctly?

Thank you.
B
5
S
1
G
1
Posts: 157
Reputation: 1,219

Post » Fri Dec 23, 2011 3:21 pm

Here's what I'd do:

Always Set Score X = DisplayWidth - Digits.Width - Score.Width

or

Always Set Score X = Digits.X - Score.Width

You'll have to do some tweaking to make it look nice of course, and not clumped up or cut off. I don't know if the origin on Text objects is on the far left of the textbox or if it's centered. If it's centered, use the first one. If not, the second one should work fine.TL222011-12-23 15:22:41
B
56
S
20
G
7
Posts: 305
Reputation: 8,754

Post » Thu Dec 29, 2011 1:26 am

Forgive me. I am still learning the way this program works.
This is what I have:

+ System: Always (every tick)
-> Score: Set text to "Score: " & Score ('score')
-> System: Set global variable 'Score' to Score ('score')

And I have tried but I keep getting errors. I am not putting bits in the right places it seems. I am not sure how the Xs work out in this, or if they are variables. Could you clarify it just a bit more for me please?

Thank you.
B
5
S
1
G
1
Posts: 157
Reputation: 1,219

Post » Thu Dec 29, 2011 11:41 am

+System: Always (every tick)
->Score: Set text to score('score') & " Score"
works for me.

Or use two text objects.

Not sure if that's what you were trying to do though.
B
6
S
1
G
1
Posts: 69
Reputation: 1,019

Post » Fri Dec 30, 2011 4:50 am

I got it now. That works and I understand it more now. Thank you.
B
5
S
1
G
1
Posts: 157
Reputation: 1,219


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest