我想知道如果有人知道如何添加文本,点击时,会带你到另一个网站在Game Maker Studio 2。
创建一个新的对象。
创建活动:
text = "your text"; link = "url"; font = your_font; draw_set_font(font); var width = string_width(text); var height = string_height(text); var offset = 5; left = x - offset; top = y - offset; right = left + width - 1 + offset; bottom = top + height - 1 + offset;
全球鼠标左按下:
if point_in_rectangle(mouse_x, mouse_y, left, top, right, bottom) { url_open(link); }
绘画事件:
draw_set_halign(fa_left); draw_set_valign(fa_top); draw_set_font(font); draw_text(x, y, text);