Legacy GM GUI Buttons Positions

Imperial

Member
I have a button with this Script
Code:
//Draw Event
x = view_xview[view_current] + 32;
y = view_yview[view_current] + view_hport[view_current] - sprite_height * 1.25;
draw_self();
the problem Is when I scale up the view using this Script
Code:
if(view_wview[view_current] > 800)
{
    if mouse_wheel_up()
    {
        center_of_space_x = view_xview+view_wview/2;
        center_of_space_y = view_yview+view_hview/2;
        view_wview -= view_wview * 0.1;
        view_hview -= view_hview * 0.1;
        view_xview = center_of_space_x - view_wview/2;
        view_yview = center_of_space_y - view_hview/2;
    }
}
the position of the buttons changes

thanks for supporting :)
 
G

guadalcanal

Guest
I typically use view_hview[...] rather than view_hport[...]. Also, in your scale script you aren't using view_xview as an array, I think that may be a problem. Alternatively, try using the Draw GUI event, that is ideal for buttons and stuff.
 
Top