I am trying to find some example code or just the logic behind how kids coloring apps work? I guess the main aspect I’m looking for is how draw with your finger on the screen. I’m sure it is simple, but want to make sure I do it correctly. [import]uid: 79834 topic_id: 27971 reply_id: 327971[/import]
(Assuming the child can only paint in a certain colour for each area of the pictures) I think that in Corona’s case you’d want each section of the image to be a different display group with a mask. Touch the screen anywhere would paint a new circle (or whatever) on that position, in that area with the given colour. Any time there is a lack of touch events for more than, say, 5 seconds, save the coloured portion into a new image and delete the old (many) circles. This will improve performance.
Just an idea… [import]uid: 8271 topic_id: 27971 reply_id: 113201[/import]
Thanks for your quick reply Horace. This definitely makes sense. My question now is - how do you take all of the circles drawn and turn them into a new image? Also, if you turned all of the circles into one new image, how do you then do an erase function? [import]uid: 79834 topic_id: 27971 reply_id: 113248[/import]
I have two thoughts on this. The question is do you want to force them to color within the lines? If you look at games like Draw Something, they don’t constrain where you can draw/paint. And if you think about a kids coloring book, nothing prevents them from coloring outside the lines.
Since Corona SDK does not support bitmap work, what @horacebury said may be the way to go. I was working on something like this back when masks were buggy, and I was using multi-layered graphics where each layer had a mask. For instance to draw tug boat, the overall boat would be one layer, the stripe at the top of the sidewall (gunwell in boat terms) would be a sepearte graphic. The helm would be another, the steam pipes another. I was just going to do a setFillColor on the layer once it was touched. But I think I like @horacebury’s idea so that way they could actually color.
[import]uid: 19626 topic_id: 27971 reply_id: 113266[/import]
There is a display group save function which allows you to save a group into a single image. You can then take that and place it back into your collection of groups and remove the original images. I’ve not done it but there was a release a few weeks ago (and a blog post) which showed that the performance has gone up a lot with the ability to save to memory; Previously it was to filing system and slow. It’s the same principle some devs have tried to mag an iOS style magnifying glass with. [import]uid: 8271 topic_id: 27971 reply_id: 113293[/import]
Am sure there is some drawing code in the share your code section. Also checkout the marketplace forums there was a company (forget there name now) selling a corona drawing template and it looked pretty damn good.
Dave [import]uid: 117617 topic_id: 27971 reply_id: 113411[/import]