[Solved] ...use masks in complex situations?

Get help using Construct 2

Post » Thu Jan 16, 2014 3:28 pm

hey everyone,

I'm not sure how to best phrase it but i know often people call them masks in Flash and other places. I have an animation that's one long graphic that i want to scroll across th screen, BUT the catch is that i only want it seen inside a certain area and that area is on top of the rest of the scene.

Can C2 use / make / however it works, have a mask effect? If so where would I start?

Thanks!
Calebpart12studios2014-01-17 15:48:19
B
59
S
9
G
1
Posts: 970
Reputation: 6,611

Post » Thu Jan 16, 2014 3:32 pm

Take a look at the blendmode example shipped with C2.
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 » Thu Jan 16, 2014 3:40 pm

ooo interesting.. so blend mode is what i should be looking for

Thanks!
Caleb
B
59
S
9
G
1
Posts: 970
Reputation: 6,611

Post » Thu Jan 16, 2014 4:42 pm

hmmm ok so it seems like destination in would be ideal.. i have a mask graphic that is the right shape and i would only want the item i mark as destination in (like the example)

it seems like there would need to be some way to link the two objects. the examples in C2 are nice, but deal with a single graphic on a solid color background.. my mask is a solid color graphic (my window to the animation if you will) on top of a colorful environment.

I'm just not sure.. how to approach this. every combination of the blend modes either of the masked item or the masking item results in unacceptable results. maybe if i put them on another layer it would help? but i don't see how.

i have to set the masking graphic to destination over so it's invisible to all other graphics, otherwise what good is a mask if you can see the mask right?

the closest thing on the masked item that works in combination with thing item needed maked is set to Destination out, which you can see a clear difference between what's inside and what's outside the area to be exposed.. however the issue is that i can still see the masked object, albeit in another weird color.

Maybe I need to use one of the more advanced effects? Overlay and Exclusion were interesting because they did crop the image but only to the side of the stage which isn't enough.

To me the ideal solution would be to have a graphic that is 100% transparent to the viewer, but then have my other graphic be 100% hidden except when in empty (really transparent space) and not cause color distutions when the masked object passes over other colored background objects.

https://www.dropbox.com/s/tpwsekb5kv5prpu/Screen%20Shot%202014-01-16%20at%2011.48.34%20AM.png

this is one shot of what i'm seeing. This is just about perfect except that its' solid green blocking all of the other stuff. When i get it to be basically transparent, but not really masking the masked object it looks like this plus color distortion

https://www.dropbox.com/s/4fh8mzvzw5qt3xt/Screen%20Shot%202014-01-16%20at%2011.46.03%20AM.png

again close.. almost perfect if i didn't get the color distortion and the fact that you can see the effect through the mask.
Thanks!
Calebhttps://www.dropbox.com/s/tpwsekb5kv5prpu/Screen%20Shot%202014-01-16%20at%2011.48.34%20AM.png https://www.dropbox.com/s/4fh8mzvzw5qt3xt/Screen%20Shot%202014-01-16%20at%2011.46.03%20AM.pngpart12studios2014-01-16 16:56:18
B
59
S
9
G
1
Posts: 970
Reputation: 6,611

Post » Thu Jan 16, 2014 4:59 pm

I can't get to my C2 right now, but it should be something like this:

Put mask and object on seperate layer, put the mask above the object you want to show partly, set the mask to destination in, set the layer to force own texture.
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 » Thu Jan 16, 2014 5:18 pm

nevermind.. i found that.. still working through it to see if i can get closer to a good result.. so far it's the same. but i could be doing something wrongpart12studios2014-01-16 17:20:26
B
59
S
9
G
1
Posts: 970
Reputation: 6,611

Post » Thu Jan 16, 2014 5:30 pm

ok so i'm trying some different things.. i did get it to look like this.. so far..   

https://www.dropbox.com/s/hthlo60058m96ex/Screen%20Shot%202014-01-16%20at%2012.28.26%20PM.png

but quick side quetsion.. why does my Z order screen often show a given object all by itself on a layer.. while there are other things on the same layer but yet it's showing that it's by itself? wouldn't all thing on layer 1 for example show they are on Layer1?   

https://www.dropbox.com/s/m13rj93ygurd2oo/Screen%20Shot%202014-01-16%20at%2012.29.08%20PM.png

ok nm.. i guess it does that when you click on a specific object.. just weird.. but i see them together if i click into empty space. :)part12studios2014-01-16 17:32:02
B
59
S
9
G
1
Posts: 970
Reputation: 6,611

Post » Thu Jan 16, 2014 5:58 pm

In the blendmode example the cog has a transparent area around it, it's the transparent area that blocks out the second spite where it doesn't seem to overlap. so if your mask sprite is the same height as the object sprite and the object sprite gas transparancy the mask sprite will be invisible. Put them on a seperate layer with force own texture and it will work.
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 » Thu Jan 16, 2014 6:05 pm

Blendmode example

Move the yellow flubber around to see how the effect is created.
Layer has force own texture. yellow has source in blendmode and is above the mask sprite.
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 » Thu Jan 16, 2014 7:10 pm

man that's trippy :)   but yea ok i'll play with this and see what i come up with.. very cool :)
B
59
S
9
G
1
Posts: 970
Reputation: 6,611

Next

Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider] and 26 guests