Get Correct Mouse Positions when Scaling Layout

Get help using Construct 2

Post » Tue May 29, 2012 4:09 pm

I have a game at the moment that rescales the layout a lot to zoom in and out, Because layer scaling was slow.

I was wondering if there was a way to get the correct mouse positions when zooming in and out.

I have notices that if you choose "On Object Clicked" the mouse position used for that always works.

http://wickergaming.net/games/TEST/MouseBug/

There is my example of the bug/I'm not sure.

http://wickergaming.net/games/TEST/MouseBug/Layout,Mouse.capx

Here is the *.capx to.

-----

Things I have tried.

Inserting a non-scaleable(0 Scale Rate) layer with 0,0 parallax. Then using..

Mouse.X("LayerName") or Mouse.X(2)
Mouse.Y("LayerName") or Mouse.Y(2)

Also tried the same method with a normal layer fully default.

The closest I could ever get was by doing..

Mouse.X/LayoutScale
Mouse.Y/LayoutScale

But it kind of moved around like an oval..hard to explain lol.

----

Thanks in advance any help greatly appreciated!michelangelo2012-05-29 16:11:08
B
10
S
2
Posts: 20
Reputation: 1,258

Post » Tue May 29, 2012 6:20 pm

Total guess, but there are the mouse.absoluteX and mouse.absoluteY expressions.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Tue May 29, 2012 6:40 pm

They are used for onscreen coords instead of layout coords, I tried those. Thanks for trying to help though. I appreciate it.
B
10
S
2
Posts: 20
Reputation: 1,258


Return to How do I....?

Who is online

Users browsing this forum: Colludium and 30 guests