Working with 180° rotated layers

Get help using Construct 2

Post » Thu Aug 23, 2012 11:07 pm

So I rotated all of my layers except the GUI layer by 180°. I also have a sprite that should be at mouse x,y.

So I got this math (LayoutWidth is the same as WindowWidth, LayoutHeight is several times bigger than WindowHeight with a constant Y scroll from LayoutHeight towards 0):

Sprite set position to
X = LayoutWidth-Mouse.X
Y = (LayoutHeight-WindowHeight)+(LayoutHeight-Mouse.Y)

The scroll is -0.10px every tick, and with that the difference between the mouseY and SpriteY gets bigger and bigger every tick.


What part am I missing here?
B
33
S
12
G
7
Posts: 227
Reputation: 7,582

Post » Fri Aug 24, 2012 12:13 am

Mouse.X(LayerNumber) will return the position in the specified layer according to its angle.

When dealing with rotated layers/layouts, that's generally the issue.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Fri Aug 24, 2012 12:25 am

Well, that does the trick, thanks.
B
33
S
12
G
7
Posts: 227
Reputation: 7,582


Return to How do I....?

Who is online

Users browsing this forum: marekmk and 3 guests