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
31
S
13
G
2
Posts: 490
Reputation: 5,011

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
378
S
219
G
84
Posts: 23,854
Reputation: 187,841

Post » Mon Jun 17, 2013 3:44 pm

That worked. Thanks :)
B
31
S
13
G
2
Posts: 490
Reputation: 5,011


Return to How do I....?

Who is online

Users browsing this forum: KittenKatja, luckyrawatlucky, QuantumMMX and 14 guests