| CODE |
| { //argument0 = tekstin x-sijainti //argument1 = tekstin y-sijainti //argument2 = teksti //argument3 = tekstin mouse-off väri //argument4 = tekstin mouse-on väri var tx_x,tx_y,tx_str,tx_w,tx_h,on; tx_x = argument0; tx_y = argument1; tx_str = argument2; tx_w = string_width(tx_str); tx_h = string_height(tx_str); on = (mouse_x > tx_x and mouse_x < tx_x + tx_w and mouse_y > tx_y and mouse_y < tx_y + tx_h); font_color = argument3; if on = 1 { font_color = argument4; } draw_text(tx_x,tx_y,tx_str); return on; } |
| CODE |
| { if text_on(16,16,"Exit",c_black,c_white) and mouse_check_button(mb_left) { game_end(); } } |