Setting object width according to a variable.

For questions about using Classic.

Post » Mon Jun 22, 2009 7:06 pm

I've basically hit a wall here. I want the object to change it's width to be the value of a variable. If the variables value was 2, the object's width would be 2 pixels, if 35 it would be 35 pixels wide. I've tried setting it from set width of object and inputting the name of the global variable in the value box of the window. Anyone want to shed some light on this problem of mine?

Thanks in advance!
B
1
G
3
Posts: 3
Reputation: 831

Post » Mon Jun 22, 2009 7:38 pm

[code:1vbb3qyv]Object: Set Width to global('variable')[/code:1vbb3qyv]

That should be it.

Things to double-check:
[list:1vbb3qyv]
[*:1vbb3qyv]Make sure your variable is a number and not text[/*:m:1vbb3qyv]
[*:1vbb3qyv]Make sure you're using the proper single quotes[/*:m:1vbb3qyv]
[*:1vbb3qyv]Make sure you're not setting the width again after your event (this will override it)[/*:m:1vbb3qyv]
[*:1vbb3qyv]Make sure your event is triggering properly (all conditions are met)[/*:m:1vbb3qyv][/list:u:1vbb3qyv]

If it's still not working then post your .cap.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Jun 22, 2009 7:49 pm

It worked out exactly the way I wanted it to work! Thanks! I'm still working on learning all the little nuances of this program.

I appreciate the help.
B
1
G
3
Posts: 3
Reputation: 831

Post » Mon Jun 22, 2009 11:10 pm

If you're struggling with the basics, maybe try out one of the tutorials?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests