• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML Menu Button scales up when selecting it

E

E4gy

Guest
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:
E

E4gy

Guest
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