How to read canvas.width/height?

Get help using Construct 2

Post » Sun Jun 16, 2013 4:47 pm

Or the width and height of an object after the canvas has been scaled? Is it possible? Using the runtime.width/height commands seem like they could do the trick but I don't know how to use them inside events; the editor complains that runtime is not a behavior when I try.
B
40
S
16
G
6
Posts: 543
Reputation: 7,649

Post » Sun Jun 16, 2013 6:23 pm

Use the system "compare two values" and input your values there

Note that compare two values does not do any picking...
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,270

Post » Sun Jun 16, 2013 10:19 pm

You're confusing javascript with Construct 2 expressions. In the Construct 2 editor it's WindowWidth and WindowHeight, but don't confuse them with the viewport.
Scirra Founder
B
403
S
238
G
89
Posts: 24,653
Reputation: 196,143

Post » Mon Jun 17, 2013 3:44 pm

That worked. Thanks :)
B
40
S
16
G
6
Posts: 543
Reputation: 7,649


Return to How do I....?

Who is online

Users browsing this forum: jojomickymack, Ryan Kocourek, Yahoo [Bot] and 28 guests