Adjusting mouse for zoom?

For questions about using Classic.

Post » Wed Mar 11, 2009 10:15 pm

Zooming out seems to affect mouse position in a very strange way. The 0,0 coordinate moves further and further outside the frame up and to the left.

I'm not sure how to explain this but it seems all zoom values below 100% except for 50% break coordinates. Running with debug on, I tested the "640x480" point on the layout, and it moved around from 99% to 51% then when it hit 50%, 640x480 was exactly where it was at 100%.

I really have no idea what's going, but no matter which formula I came up with, I couldn't account for this bizarre offset (Though accounting for the mouse speed change was easy enough, dividing by (zoom/100)).

So, I give up. What's going on here?
B
4
G
6
Posts: 32
Reputation: 1,514

Post » Wed Mar 11, 2009 10:53 pm

Do you have a cap to post?
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Wed Mar 11, 2009 11:06 pm

Does this also seem to effect where the mouse can click on sprites/buttons?
B
2
S
2
G
4
Posts: 136
Reputation: 1,722

Post » Wed Mar 11, 2009 11:12 pm

I don't have anywhere to host the file but to get it to happen just set an object to the mouse position then zoom out. You can then see the mouse is operating on its own set of positions independent from the layout's.
B
4
G
6
Posts: 32
Reputation: 1,514

Post » Thu Mar 12, 2009 3:20 am

'MouseX' and 'MouseY' only account for global zoom; if you use 'MouseX("layername")', you get the appropriate value for that layer.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Thu Mar 12, 2009 9:03 am

[quote="Ashley":2dzbpsqx]'MouseX' and 'MouseY' only account for global zoom; if you use 'MouseX("layername")', you get the appropriate value for that layer.[/quote:2dzbpsqx]

[size=150:2dzbpsqx]Hidden Feature alert![/size:2dzbpsqx]
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Thu Mar 12, 2009 11:01 am

It's documented in System Expressions, is that really hidden? :P
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests