• 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 Objects are invisible if I add a DRAW event on them...

A

ArtCode

Guest
Hello, Noob question here!
Why the objects in the game become invisible if I add to them a DRAW EVENT?
It's there a way to not make them invisible? Because in other way I need to create an empty object (without a sprite) only for them... I want to avoid to add a lot of empty objects...
 

chamaeleon

Member
Presumably due to you not calling draw_self(). Without a draw event this happens automatically, but as soon as you add a draw event GameMaker does not assume anything about what you want to display, so you need to provide every draw action, including the drawing of the assigned sprite, if that is what you want in some given use case.
 

Simon Gust

Member
If objects don't have a draw event, game maker will automatically draw them the way it wants, if you add a draw event game maker lets you decide how you want to draw the object.
Adding a
Code:
draw_self();
makes it a basic drawing of the current sprite.
 
A

ArtCode

Guest
LOVE YOU GUYS! It was simpler than I thought :) Thanks a lot!
 
Top