Im having trouble in YoYo GM with an object's draw event?

zackattackyo

New member
I am not an expert at YoYo gm for sure. In one game im making, i have a player object and it has four sprites. whenever you press an arrow key, it changes certain variables. for example, when you press the up key, it of course moves up, and it sets these variables: Up 1 Down 0 Left 0 Right 0. and in the step event it checks the variables and changes to the correct sprite. But in the draw event, i tried drawing a variable (credits is the name of the variable) relative 100,100 to the player object. but when i test the game, i can see where it drew the variable, but it doesnt show the player sprite, but i know its there because i have the view set to follow the character and when i press the arrow keys the view moves and so does the text of the drawn variable. PLEASE HELP ME!
 
When you use the draw event, you are telling the game to ignore anything pre-drawn and only draw what you tell it to.

The easiest way to fix it would be to just create a new object without a sprite and just have it draw the variable. Also, you may have to get the variable from your player object so use something like this

\Gets the variable from player object.
variable = player.variable;

\Draws variable
draw_text(player.x - 100, player.y - 100, variable);
 
Back
Top