Make a Paint bucket game?

Hello Community,

I’m trying to find help on how to make a Paint bucket fill a shape.

image
image

GAME: so if the cursor is in the circle and mouse is clicked - fill it with chosen color.

I’ve looked online for examples of this but not seen anything done like this.

I found GDevelop 5 … but this only allows you to pick a color and then draw freehand with it.

Any help would be appreciated - Thanks

Is the circle drawn on a shape painter or is it a sprite? There’s no flood or fill event that I’m aware of. There’s a drawing example or template project. Can you tell us more about your project?

You can draw circles with a fill color. Or change the tint of an object. If you used white then any white part would be tinted that color. Or I guess you could use a color replacing object effect.

The options that I can think of require each shape to be a separate object. None are especially efficient. Although, if it was a relatively simple project it wouldn’t be much of an issue. (I mean simple as in not a lot of objects and little movement, not in number of events or ease of creating it)

Hello @Keith_1357, sorry for the late reply.
I did use a sprite.

If you’re coloring sprites then you could make the shape and fill it with white leaving the outside transparent and then if you change the objects tint then the white would become the tint color.

Add a group, name it shapeGroup and add the shape sprites to it.

This uses 2 variables.
A scene variable named currentColor set to 255;255;255
(colors are represented by a text value with the color’s value of 0 to 255 for red, green and blue separated by semicolons.)

The colorSelector has an object variable named color and an outline object effect.
Set the instance variable for each color selector to the desired color.
Example: 255;0;0 is red 0;0;255 is green

These are the events

try me:
https://games.gdevelop-app.com/game-f61300ca-e261-4be2-9780-3ab323e51064/index.html

my project (click the green [code] button, select [download zip], extract and open the json file)
https://github.com/doug13579/gdevelop-simple-coloring-book-like-example