How do I paint within a mask?

Get help using Construct 2

Post » Fri Apr 17, 2015 1:19 am

I'm a beginner working on a game for my kids who like to "paint" on the screen. I'm going to create a "mask" - black and white version of the image, say a car, and then enable them to select a color and "paint" the area they want to... to make it easier I don't want the paint to work outside the masked area.

I have found the tips on drawing using lines vs just following the mouse pointer, but I haven't found any way to use a tile or a sprite as a mask so that the paint only stays in the enclosed area. See http://www.cartoonito.co.uk/tv-show/fir ... nting-game but imagine this as painting not a "paint bucket like fill".

Ideally, I'd like to just stop the paint stroke if it hit a black line in an imported image, so I don't have to "code" each image individually.

Any ideas or examples you've seen?

D.
B
3
Posts: 2
Reputation: 179

Post » Fri Apr 17, 2015 9:29 am

I guess you could try using blendmodes for this..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Apr 25, 2015 3:17 am

Great idea LittleStain... it works, but I can't find an easy way to "import" a new image. I have to create a new sprite for every image. I can't just import a black and white JPG, SVG or BMP.

That's why I was hoping to use the "mask" idea... so I'd import an image as a mask and that would be all that could be painted.

Make sense?
B
3
Posts: 2
Reputation: 179

Post » Sat Apr 25, 2015 8:12 am

So what you could do..

Draw inside the lines

This is far from perfect and pretty intensive because of the amount of sprites created, but it shows how combining blendmodes and effects can create the effect you're aiming for..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 32 guests