GarbageHaus
Member
I am trying to create something where a button is pressed and text appears in a box but I am stuck on the most basic steps. For example I have the following Draw Event tied to my button:
This creates the text but it is not in the box I need it in and once I release the mouse button, the condition is no longer true and therefore the text goes away.
I've tried other methods such as making the line be:
in the hopes that by using the draw_text function tied to another Object it will not clear it automatically once the condition stops being true, thus solving both problems. However, this yielded an exception so I'm sure my syntax is wrong somewhere.
I've tried using other Events besides "Draw" but for some reason "Draw_text" only seems to function as part of an if statement or within the "Draw" Event except in the "Mouse - Left Down" event where it does not function at all.
How am I supposed to click a button and have a "textbox" Object contain said text after clicking?
GML:
//Press Vs to Get Monsters
var monster1 = ["Fire",55,"Dragon"]
draw_sprite(spr_vs,0,x,y)
if mouse_check_button(mb_left) then draw_text(x,y,monster1[2])
I've tried other methods such as making the line be:
GML:
if mouse_check_button(mb_left) then obj_textbox.draw_text(x,y,monster1[2])
I've tried using other Events besides "Draw" but for some reason "Draw_text" only seems to function as part of an if statement or within the "Draw" Event except in the "Mouse - Left Down" event where it does not function at all.
How am I supposed to click a button and have a "textbox" Object contain said text after clicking?