zoom and buttons

Got a question? Need help? Post here!

zoom and buttons

Postby tet2brick » Mon Mar 10, 2014 5:16 am

Hi,

I have a stage with a user interface composed of clickable buttons.

I've all the elements of the UI to zooms=false

When I zoom by any factor, the button size don't change, but the button clickable area seem to be modified by the zoom.
If I made them zoom with all the stage, they work properly.

What can I do?

Thank you!
tet2brick
Corporal
 
Posts: 19
Joined: Thu Jun 13, 2013 1:42 am

Re: zoom and buttons

Postby Arkeus » Wed Mar 12, 2014 9:44 pm

Zooms is still pretty experimental. I'm working on changes regarding zooming in the new version, so hopefully it will become more reliable at that point.

For now I'd suggest overriding the method the hover() method of AxButton and implementing it yourself, based on your needs (taking into account zooms for example). The main thing is you'll need to multiple the mouse positioning by your zoom level in order to correctly calculate whether you're hovering over the button (since the world coordinates are scaled up based on your zoom level).
Image
User avatar
Arkeus
Site Admin
 
Posts: 363
Joined: Mon Mar 26, 2012 12:43 am

Re: zoom and buttons

Postby tet2brick » Mon May 05, 2014 7:20 am

Okay, I will adapt my code, thanks! :)
tet2brick
Corporal
 
Posts: 19
Joined: Thu Jun 13, 2013 1:42 am


Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron