Código: Selecionar todos
/// CREATE
text = "Set as alpha"
widht = 96;
height = 28;
hover = false;
display_x = xstart*global.display_scale;
display_y = ystart*global.display_scale;
Código: Selecionar todos
///STEP
var xhover = (global.gui_mouse_x == median(display_x-width/1, global.gui_mouse_x, display_x+width/2));
var yhover = (global.gui_mouse_y == median(display_y-height/2, global.gui_mouse_y, display_y+height/2));
hover = xhover & yhover
Código: Selecionar todos
///DRAW_GUI
if (hover) {
draw_set_alpha(.2);
} else {
draw_set_alpha(.5);
}
draw_rectangle(display_x-width/2, display_y-height/2, display_x+width/2, display_y+height/2, false);
draw_set_alpha(1);
draw_set_halign(fa_center);
draw_set_valign(fa_middle);
draw_text_colour(display_x, display_y, text, c_white, c_white, c_white, c_white, 1);
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object obj_gui_button:
Variable obj_gui_button.width(100055, -2147483648) not set before reading it.
at gml_Object_obj_gui_button_StepNormalEvent_1 (line 2) - var xhover = (global.gui_mouse_x == median(display_x-width/1, global.gui_mouse_x, display_x+width/2));
############################################################################################