• Hey! Guest! The 37th GMC Jam will take place between May 28th, 12:00 UTC and June 1st, 12:00 UTC. Why not join in! Click here to find out more!

GML Menu Button scales up when selecting it

E4gy

Member
I succeeded making the certain button turn blue, but i also wanna make the selected button scale up to 2x of it's original size.

screenshots:
upload_2018-12-21_12-20-29.png

upload_2018-12-21_12-21-34.png


upload_2018-12-21_12-22-10.png

if you ask, this video helped me creating these codes:
 

Attachments

Code:
var i= 0;
repeat (buttons) {
     DrawSetText(c_gray, fMenu, fa_center, 0);
 
    if (menu_index == i)
    {
         draw_set_color(c_blue);
         image_xscale = 2;
         image_yscale = 2;
         draw_set_color(c_white);
    } else {
        image_xscale = 1;
        image_yscale = 1;
    }

   draw_sprite_ext(sButton, 0, x, y, image_xscale, image_yscale, 0, image_blend, image_alpha);
   draw_text_transformed(menu_x, menu_y + button_height * i, button[i], image_xscale, image_yscale, 0);
   i++;
}
 
Last edited:

E4gy

Member
Code:
var i= 0;
repeat (buttons) {
     DrawSetText(c_gray, fMenu, fa_center, 0);
 
    if (menu_index == i)
    {
         draw_set_color(c_blue);
         image_xscale = 2;
         image_yscale = 2;
         draw_set_color(c_white);
    } else {
        image_xscale = 1;
        image_yscale = 1;
    }

   draw_sprite_ext(sButton, 0, x, y, image_xscale, image_yscale, 0, image_blend, image_alpha);
   draw_text_transformed(menu_x, menu_y + button_height * i, button[i], image_xscale, image_yscale, 0);
   i++;
}
thanks a lot
 
Top