Layout Scale makes Mouse.x and Mouse.y not work correctly?

Get help using Construct 2

Post » Sun Mar 23, 2014 5:12 pm

When I set the layout scale to 3, it makes the X of the mouse and the Y of the mouse be registered incorrectly? Im trying to make it so when I click somewhere it creates an object, and I am using layout scale to zoom in the project, and when I click it spawns the object a bit to the left or right depending on where the character is?
B
5
S
1
Posts: 54
Reputation: 508

Post » Sun Mar 23, 2014 5:21 pm

Maybe this will help.. from the manual.

Mouse expressions

AbsoluteX
AbsoluteY
Return the position of the mouse cursor over the canvas area in the HTML page. This is (0, 0) at the top left of the canvas and goes up to the window size. It is not affected by any scrolling or scaling in the game.

X
Y
Return the position of the mouse cursor in game co-ordinates. This is (0, 0) at the top left of the layout. It changes to reflect scrolling and scaling. However, if an individual layer has been scrolled, scaled or rotated, these expressions do not take that in to account - for that case, use the layer versions below.

X("layer")
Y("layer")
Return the position of the mouse cursor in game co-ordinates, with scrolling, scaling and rotation taken in to account for the given layer. The layer can be identified either by a string of its name or its zero-based index (e.g. Mouse.X(0)).
B
47
S
16
G
9
Posts: 1,097
Reputation: 11,180

Post » Thu Mar 27, 2014 12:00 am

Thanks,
X("Layer")
and
Y("Layer")
was what I needed! ^_^
B
5
S
1
Posts: 54
Reputation: 508


Return to How do I....?

Who is online

Users browsing this forum: armen1997, Syazanie Amirin and 10 guests