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
41
S
19
G
65
Posts: 1,085
Reputation: 37,842

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
168
S
50
G
163
Posts: 8,221
Reputation: 105,061

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
91
S
31
G
102
Posts: 5,232
Reputation: 67,250

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
41
S
19
G
65
Posts: 1,085
Reputation: 37,842

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
168
S
50
G
163
Posts: 8,221
Reputation: 105,061

Post » Sun Jan 15, 2017 5:18 pm

they ought to fix that too.
B
41
S
19
G
65
Posts: 1,085
Reputation: 37,842


Return to How do I....?

Who is online

Users browsing this forum: Darth Crusher, NyxoGe, zsoldiers and 4 guests