GMS 2 How to place objects with draw event

Suzaku

Member
Im starting to use the draw event to draw everything, as I ve been told thats a more professional way to draw stuff, but Im having problems, more specially when I have to figure out quickly the coordenates to put my fixed objects(like walls, ground, static things).on my backgrounds. Is the draw event really more useful than simply using the room editor to drag and drop things? Thank you for your time.
 

obscene

Member
By far the most optimal way to draw stuff is to let GM automatically draw it. You don't want to micromanage drawing unless you have a specific reason to do so and it doesn't sound like you do.
 

NightFrost

Member
Whenever you drag an object from the resource tree to the room editor, you are creating an instance. Many times this is just what you want and need. But coding a draw routine is sometimes the better way, when you don't need the stuff that being an instance brings, like for example a collision mask. And sometimes just one instance is all you need; for example a titlescreen menu doesn't really need more than one to handle everything it does and displays. It depends on what you are trying to do.
 

woods

Member
with a "controller object in your titlescreen for example.. you can use this to draw the title of your game, and the play button etc...

instead of making an object and giving it a sprite just to have your title on screen.
and another button object to click on for the play button... just draw the play sprite and check for mouse click in bbox

basically(not always true but in general)
the less "things" in your room the more efficient it will become.
 

Rob

Member
Im starting to use the draw event to draw everything, as I ve been told thats a more professional way to draw stuff, but Im having problems, more specially when I have to figure out quickly the coordenates to put my fixed objects(like walls, ground, static things).on my backgrounds. Is the draw event really more useful than simply using the room editor to drag and drop things? Thank you for your time.
I don't know if it's more "professional" or not.

Is another system better than 1 instance = a tree/Rock/wall? It can be.

In GM2 I like to use tiles as much as possible. It's basically the same as dragging objects but without the overhead and you still have the bonus of being able to manually place things.

If you use the auto tiling feature then you can build levels quickly.

For most platformers/RPGs that's all you'll need.

For drawing buttons and gui items then learning how to use coordinates and functions rather than objects will be good practice for you.

At the end of the day, finishing the game is better than getting stuck because you're not familiar with something.
 
Top