• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML "Draw Sprite" on click

E

Ellys

Guest
Hey coders,

I want to draw a sprite on click and have it stay there until I click again.
This is what i have so far.

if mouse_check_button_released(mb_left) && position_meeting(mouse_x, mouse_y, oStats)
{
draw_sprite(sStatBG, 0, 400, 400);
}

I understand the draw function is usually in the draw event but that draws the sprite immediately instead of on click. So this code is currently in my step (evidently doesn't work)

Any help would be appreciated, thank you.
 

curato

Member
If I were doing it I would make the object and use a variable to store the true false of if it is clicked or not then override the standard draw even with an if statement of if clicked is true then call draw_self to get the sprite assigned to the object.
 
Top