<undefined>
0
-1
-99
0
<undefined>
<undefined>
1
603
7
0
0
-1
2
self
0
0
1
// yes this is a copy of oEditrButton no i didn't use a parent why are you asking?
/* be sure to set these variables manually in a with or something or else
this won't work.. and we sure don't need more spaghetti like THAT
button_width = 40; divides this number by 2 in draw
button_height = 10; also divides this by 2 in draw
button_x = 0; uses this to link to oEditorTab properly (0 = middle)
button_y = 0; uses this to link to oEditorTab properly (0 = top)
button_flag = -1; determines what oEditorTab will recieve and likewise send to oTrialEditor
button_string = "String"; says a funny
button_sprite = -1; shows a funny (only if button_string isn't filled)
button_border = c_white; button border color. amazing
below are included vars. don't bother setting them yourself*/
button_alpha = 1; // rises in value initially for a nice little fade in effect
button_highlight = 0;
1
603
7
0
0
-1
2
self
0
0
1
// highlight code
if (mouse_x > x-(button_width/2) && mouse_x < x+(button_width/2) && mouse_y > y-(button_height/2) && mouse_y < y+(button_height/2) && oEditorInfo.type_mode == -1){ // still ew, but... no, no "buts." this is ew.
button_highlight = 1;
if (mouse_check_button_pressed(mb_left)){
oEditorInfo.relay_button = button_flag;
sfx_play(sndMenuSel);
}
}else{
button_highlight = 0;
}
1
603
7
0
0
-1
2
self
0
0
1
// move x/y
x = oEditorInfo.x+button_x;
y = oEditorInfo.y+button_y;
// everything is drawn from the center
var round_x = round(x);
var round_y = round(y);
draw_set_color(button_border);
// the contents
// the box
draw_set_alpha(1);
draw_rectangle(round_x-(button_width/2),round_y-(button_height/2),round_x+(button_width/2),round_y+(button_height/2),true);
// the contents
if (button_string == ""){ // sprite
var sw = sprite_get_width(button_sprite);
var sh = sprite_get_height(button_sprite);
draw_sprite_part(button_sprite,0,0,0,sw,sh,(0-(sw/2))+round_x,(0-(sh/2))+round_y); // this is a really dumb way of forcing the sprite to the middle
}else{ // string
draw_set_font(fontMenuTinyDefault);
draw_set_color(c_white);
draw_set_halign(fa_center);
draw_set_valign(fa_center);
draw_text(round_x+1,round_y-1,button_string);
}
// box hlight
if (button_highlight){
draw_set_alpha(0.3);
draw_set_color(button_border);
draw_rectangle(round_x-(button_width/2),round_y-(button_height/2),round_x+(button_width/2),round_y+(button_height/2),false);
}
0
0
0
0.5
0.100000001490116
0
0.100000001490116
0.100000001490116
0.200000002980232
-1
0