I'm having some trouble with the draw_text() method:
I'm trying to create a GUI which opens when the shift key is pressed and closes when it's let go:
Most of these shouldn't need too much explanation but just in case:
global.moving is a Boolean that represents if the player is currently changing position
gui_x,gui_y are pre-defined ints just to put the gui in the centre of the screen.
And this is all done in a "Draw GUI" event.
My problem is that the text does appear, but only for a few frames, and then it disappears. The sprite remains, it's just the text. Can anyone explain why this is happening? And how I might go about fixing it?
I'm trying to create a GUI which opens when the shift key is pressed and closes when it's let go:
GML:
if (!global.moving)
{
//Check for the shift key being pressed and check there isn't already a menu up
if keyboard_check(vk_shift) && !global.menupresent
{
global.menupresent = true;
gui = layer_sprite_create("GUI",gui_x,gui_y,spr_gui);
draw_text(gui_x,gui_y-180, "Menu");
}
if !keyboard_check(vk_shift) && global.menupresent
{
global.menupresent = false;
layer_sprite_destroy(spellcastinggui);
}
}
global.moving is a Boolean that represents if the player is currently changing position
gui_x,gui_y are pre-defined ints just to put the gui in the centre of the screen.
And this is all done in a "Draw GUI" event.
My problem is that the text does appear, but only for a few frames, and then it disappears. The sprite remains, it's just the text. Can anyone explain why this is happening? And how I might go about fixing it?