• 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!

GameMaker 'Drawing' in game

I

InquiziBruh

Guest
I want to make a game that lets the player 'draw' things in game, using the mouse as a sort of brush, with an adjustable radius for size. I want the object the player draws to then have a collisions on it and count as an object with its own code. Does anyone know what the best way to do this is?
 

NightFrost

Member
The main points would be:
  • Create a surface identical to draw area size.
  • When user draws with mouse, draw it to the surface and copy the surface to application surface so user can see the results.
  • When draw is finished, either A) cut the empty surroundings programmatically or B) simply require that user draws a rectangle around the area that will be used.
  • Turn the selected region into a sprite. This will create a new texture page, as usual.
  • Create a collision mask for the sprite (sprite_collision_mask).
  • Assign the created sprite to an instance that needs it.
 

Yal

šŸ§ *penguin noises*
GMC Elder
I want the object the player draws to then have a collisions on it and count as an object with its own code
Save a list of all shapes the player places down, then loop through them and use collision functions? Surfaces are good, but I'm not sure if there's any good way to get a collision mask for them. Lists and loops, however, always work :p
 
Top