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
32
S
14
G
5
Posts: 499
Reputation: 6,656

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,260

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
382
S
223
G
86
Posts: 24,002
Reputation: 189,821

Post » Mon Jun 17, 2013 3:44 pm

That worked. Thanks :)
B
32
S
14
G
5
Posts: 499
Reputation: 6,656


Return to How do I....?

Who is online

Users browsing this forum: reddragon09 and 10 guests