I’m trying to get a coloring book app done for my son. How do I make crayons to color on a page with? I have pictures for him to color, I just want to get it packed together in his app that is just for him. I keep trying to do the shape painter, but I can’t make that work at all. Any ideas?
[spoiler]I thought this would be rather difficult. Man have I been wrong. ^^
4 Events were sufficient to realize that functionality.
I absolutely love this Application.[/spoiler]
In order to get this to work, you need two images. One that works as a canvas and another for the pen texture.
You can then “copy the image ‘pen’ on ‘canvas’ at MouseX(), MouseY()” (primitive drawing) and save the image to disc afterwards.
In order to show the updated image on the screen you need to copy the modified image into the canvas object’s sprite image (“copy an image on the current one object” in Sprite - Effects)
I made an example (see the attachment file)
For real use you may want to use a timer to lessen the frequency of “blitting” the pen image onto the canvas.
Just replace the soft brush pen with an image of a crayon painted dot. The painting application “Krita” has such a brush included that you could use to create a transparent png off.
Left Mouse button to draw
Right Mouse button to save the image in the game directory as "newscreen.png"
paint.zip (6.57 KB)