Hello there! I’m making a painting game but i’m having problems changing the outline and the fill colors from the shape painter tool.
I added “Touch or Left mouse button is down” and a “Cursor is on top of…” conditions so that the player can change colors by selecting them, but they won’t work.
(I only made conditions to change colors to brown and dark red at the moment.)
I can send the project files if anyone wants them.
Thaks for your help
Your Brown image ( ) doesn’t match the brown image in the screen shot ( ). Do you have the right object in the events?
Upload your project Google Drive or any other File hosting and I’ll check it out
The color palette has no events attached to it, it’s just a UI element, the real sprites that have events are those images and they are hidden
Yeah, I figured that one out after I opened your file . Here’s what happened for me:
Do you want to try restarting GDevelop and see if that makes a difference?
I tried doing that multiple times, i noticed that if you select the color before you paint it works, but it only works for the first color that you select
I think there’s a bug with the Shape Painter. - I click on red and drew a line (in red). The I selected brown, and drew a line. It flip-flopped between red and brown while drawing the line (the image below is of one continuous line):
I added a couple of Trigger one conditions to the colour change events. No difference.
And I removed the delete and create of the shape painter too. Otherwise it clears out the drawing already done.
Well I did some modifications and I can confirm this not working at all Check the project and the video, maybe someone can clear Us what are we doing wrong or even if this is a bug.
Thanks for taking a look at my project!
Victris Games commented: "This might be related to a Pixi bug that is going to be fixed in the next release of GDevelop.
Yeah, after some checking, this looks like it is related to this: Wrong shape painter color · Issue #2644 · 4ian/GDevelop · GitHub
So this is going to stuff up your painting program. May I suggest a work around, and have a shape painter for each colour on the palette.
Then, for example, you could use an object variable to record the colour name, on both the shape painter and it’s matching palette image. Keep track of the colour name clicked on the palette, and select the matching shape painter when you draw.
I’ve actually got an idea for possibly a better solution. Let me know if you are interested, and I’ll post.
Following to the end of @Silver-Streak’s link, it looks like the fix will be in the next release of GDevelop.
I will try this tomorrow, looks like it might work until they fix the bug in the next release!
I would love to see your idea for a better solution! I’m already scratching my head over this project lol
This has been fixed for the next release.
You can test the nightly build, (make a backup of your game before)
For each of the object in your object group Colors, add an object variable RGBString, and give it the RGB string for that colour. For brown, it will be :
While you’re waiting to use the next release of GDevelop use it like :
and once the fix is in, use it like:
You won’t need to add any further code when you add another colour. It means you can add different palettes too - pastels, neon etc. The only thing would be to add the RGB string to the object.