ricardo1996
Member
Im trying to implement a zoom effect but having issues with my gui also being zoomed in on. i thought using 2 viewports would solve the issue but to avail. any help please.
im aware of the x,y positioning.Bear in mind that views are drawn from the top left, not the center.
You need to get half of the old / new view height and half of the old / new view width.
Work out where the center point of the view is with the old half view width/height then set the new view coordinates to the new half view width/height and change the view size.
I would just change the size of the view rather than using different viewports.
One thing I usually do with zooming is have a zoomLevel variable, set to 1 initially, and multiply that value by half of the initial view width/height whenever zooming out so when zoomLevel = 2, the view will show double the area, and when zoomLevel = 3, the view will show triple the area, etc etc.
Edit: its not the drawing of the buttons thats the major issue. its the button object x/y co ordinance.Why use two views when you have the GUI layer? The whole point of the GUI layer is to prevent issues like this happening as it gives a fixed layer of drawing that isn't affected by cameras or view ports. So, just use the Draw GUI events for the buttons.
Ahem... https://docs2.yoyogames.com/index.h...trols/device input/device_mouse_x_to_gui.htmlEdit: its not the drawing of the buttons thats the major issue. its the button object x/y co ordinance.
wow lol thanks for the reference i started this project way back imported from gms1. il have to do abit of depth editing with menus but thanks il give a shot laterAhem... https://docs2.yoyogames.com/index.html?page=source/_build/3_scripting/4_gml_reference/controls/device input/device_mouse_x_to_gui.html
And virtual keys do not support multiple inputs, no.
Thanks again il mark as solved.Why use two views when you have the GUI layer? The whole point of the GUI layer is to prevent issues like this happening as it gives a fixed layer of drawing that isn't affected by cameras or view ports. So, just use the Draw GUI events for the buttons.