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
48
S
23
G
66
Posts: 1,144
Reputation: 39,059

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
172
S
50
G
182
Posts: 8,432
Reputation: 115,083

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
94
S
33
G
117
Posts: 5,387
Reputation: 75,335

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
48
S
23
G
66
Posts: 1,144
Reputation: 39,059

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
172
S
50
G
182
Posts: 8,432
Reputation: 115,083

Post » Sun Jan 15, 2017 5:18 pm

they ought to fix that too.
B
48
S
23
G
66
Posts: 1,144
Reputation: 39,059


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 5 guests