shape painter object - Draw a 2d triangle/polygon / n-gon

Hi, I would really like to see the ability to draw a custom colision shape during runtime in gdevelop.

The shape painter object would be very useful if it could draw a closed polygon/n-gon shape with any number of edges.
Then we could use that shape as a colision in the game.

Drawing the polygon can be done in two steps:

  1. Plot vertices (gdevelop adds points upon this command. It stores each point’s X, Y and creation order)
  1. create/update fill shape (gdevelop creates a shape out of the points and fills it with a color)

extra commands:

  • clear shape (gdevelop clears the shape created from the points)
  • Clear points (gdevelop clears all the points )
  • Move points that were already created to new destinations

Extra conditions:

  • Upon colision with polygon (gdevelop fires an event upon colision with a polygon)
  • Polygon color = rgba value (gdevelop checks the rgba value of a polygon shape)
  • Polygon is visible (gdevelop checks if a polygon is visible)

That way for example the player could create a colision shape on the screen which can then be used to destroy enemies inside it. This could be very useful for puzzle games :smiley:

1 Like

It would be very useful (maybe not only for me) if the shapes get a changeable z-order, too.

Now I even imagine Bézier-curves and Bézier curved shapes, filled with (animated) patterns instead of one plain color.
Like in the vector-oriented graphic tools.
Bézier is the key to impressive graphics with minimal filesize.
Those vector graphics can be zoomed in and out without pixelation or loss of image quality.

Of course, those vector graphics require a procedure, to generate the final picture, they are procedurally generated.

“Procedurally generated”?
Isn’t that one of the selling arguments nowadays?
Procedurally generated landscapes seem to be well known to everybody.
Procedurally generated textures/graphics might be less common, but they can be very useful, too.

Want to make a high definition remake, because screen resolutions have increased?
Lots of work with raster graphics, no work at all with procedurally generated graphics.

Or web based games - download MB or even GB of raster graphics versus downloading just a few KB of code, to generate the graphics at the client.

I’ve seen this in a professional browser based multiplayer game, where it worked very good.

for me its just for making a colision shape really . There is an addon for construct2 that does it- its crazy complex to use though.

Is this a feature in Gdevelop now cause I really need it

oh, np I just created my own topic