• Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!

GMS 2 'Drawing' in game

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

GMC Memer
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