1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

GML Menu Button scales up when selecting it

Discussion in 'Programming' started by E4gy, Dec 21, 2018.

  1. E4gy

    E4gy Member

    Joined:
    Oct 30, 2018
    Posts:
    10
    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:
     

    Attached Files:

  2. AlexDerFerri

    AlexDerFerri Member

    Joined:
    Aug 24, 2017
    Posts:
    98
    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: Dec 21, 2018
  3. E4gy

    E4gy Member

    Joined:
    Oct 30, 2018
    Posts:
    10
    thanks a lot
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice