GameMaker: Studio

GameMaker: Studio

View Stats:
Shadowblades Sep 11, 2014 @ 5:55pm
Triggering/removing a draw text event
Hey there, I'm struggling to fully understand how draw events work.

I have an object called obj_drawroom:

In its [CREATE EVENT] it just plays music for the level.

In its [DRAW EVENT] I have empty code with a comment

In its [DRAW GUI EVENT] I have:

draw_set_color(c_white) //sets the color
draw_set_font(fnt_main) //sets the font
draw_text(x,y,"Level - 1") //draws Room 1 at current position

//draw_text(x,30,coins(score))

draw_text(500,y,"Coins: " + string(score))

The music plays, the level and coins are displayed, all of that works perfectly. My problem is, I'm trying to make the level and coins text disappear (for a screen transition).

How can I make changes to the things I draw? I only know how to setup static drawing :meatytears:

Thank you for any and all assistance! :beatmeat:
< >
Showing 1-5 of 5 comments
Sera Sep 11, 2014 @ 6:44pm 
You'll need variables to apply to your draw commands.

For example, you could in the Create event have a variable like GUI Alpha, alter its value based on whatever conditions in the Step event, and then in the GUI's draw event use that to set the opacity of what you draw. Just be sure to set draw_set_alpha() back to 1 at the end of the script, or you might get some weird surprises on the coming frames.
Shadowblades May 31, 2017 @ 11:53am 
Sorry, I know I'm almost 3 years late, but I never said thank you for your response! I was actually googling something related to Game Maker and stumbled upon my own post, haha! :cgrazz:
Gui✯_✯ Sep 14, 2022 @ 4:08am 
sorry im 5 years late i have the smae problem i set draw_text and i want to remove somewone know the comand to remove
The Winter Bud Oct 11, 2022 @ 2:35am 
Originally posted by Guilherme0_08:
sorry im 5 years late i have the smae problem i set draw_text and i want to remove somewone know the comand to remove
//create event showText=true; numberOfSeconds=10; alarm[0]=numberOfSeconds*room_speed; //alarm 0 event showText=false; //draw event if(showText){ draw_text(100,10,"Score:"+string(score)); }
Last edited by The Winter Bud; Oct 11, 2022 @ 2:36am
Gui✯_✯ Nov 4, 2022 @ 4:06pm 
Originally posted by The Winter Bud:
Originally posted by Guilherme0_08:
sorry im 5 years late i have the smae problem i set draw_text and i want to remove somewone know the comand to remove
//create event showText=true; numberOfSeconds=10; alarm[0]=numberOfSeconds*room_speed; //alarm 0 event showText=false; //draw event if(showText){ draw_text(100,10,"Score:"+string(score)); }







Thanks @The Winter Bud:steamthumbsup:
< >
Showing 1-5 of 5 comments
Per page: 1530 50