How do I rotate layer around a specific coordinate in layout

Get help using Construct 2

Post » Sat Jan 14, 2017 10:02 pm

Any way to rotate a layer around a coordinate in a layout? Seems like rotating a layer always rotates it around the center of the screen, which is lame.
B
45
S
21
G
65
Posts: 1,115
Reputation: 38,221

Post » Sun Jan 15, 2017 1:16 am

A layer, no.
A bunch of objects?
objects initial x+cos(anglelerp(0,youreverincreasingangle,youRotationspeed*dt))*distance
objects initial Y+sin(anglelerp(0,youreverincreasingangle,youRotationspeed*dt))*distance
Image ImageImage
B
169
S
50
G
174
Posts: 8,322
Reputation: 110,788

Post » Sun Jan 15, 2017 3:07 am

Maybe scroll to the point you want to rotate from, rotate, then scroll back. It may not work if the engine waits till the next frame to apply it. I haven't tried it though. Worst case you'd just not use the layer rotaion feature and rotate like newt suggests.

More general control for layers would be welcome. Instead of the parallax controls I wish layers could be moved, rotated from any point, scaled from any point X and y, and why not, skewed from any point. All those are affine transformations and it would make you and I happy to have.
B
92
S
32
G
109
Posts: 5,291
Reputation: 70,993

Post » Sun Jan 15, 2017 3:40 am

newt, That wouldn't work for tilemaps.
r0j0hound, just tried your suggestion, but it didn't work. I added a wait 1sec after rotating and repositioned scrollto, and it just rotates around wherever the center of viewport is.
More control over layers, etc would be great- I want all of those too.
B
45
S
21
G
65
Posts: 1,115
Reputation: 38,221

Post » Sun Jan 15, 2017 4:28 am

Well you can't rotate tilemaps anyway, at least not, and still do collisions.
Image ImageImage
B
169
S
50
G
174
Posts: 8,322
Reputation: 110,788

Post » Sun Jan 15, 2017 5:18 pm

they ought to fix that too.
B
45
S
21
G
65
Posts: 1,115
Reputation: 38,221


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests