Need help with layer effects.

Discussion and feedback on Construct 2

Post » Mon Sep 29, 2014 3:11 pm

Hi guys,

So basically I want to cut holes out of a layer that has a non-transparent coloured background so that the layers behind it can be seen.

The layer setup I was think of was is as followed.
  1. The lowest layer will be the background.
  2. The middle layer will use a solid coloured background.
  3. The highest layer will have sprites on it that cut shapes out of the middle layer so the lowest level is exposed.

Any ideas?

Kind regards,
Mat
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542

Post » Mon Sep 29, 2014 3:34 pm

I think some blend modes (destination in?) can be used so sprites are actually showing what is under them, however, I think they need to be on the same layer as the masking one. Just remember to verify if you need to force the texture of said layer for it to work correctly.

https://www.scirra.com/images/articles/blendmodes.png

Edit: in your context, I think it is more:

-Bottom layer
-top layer with solid color, texture forced, objects with destination out are used to see through it
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Mon Sep 29, 2014 5:08 pm

@Aphrodite the problem I had was instead of going transparent it went black like it shows in the png. However, that did help me find the solution.

So the solution was I create a layer and set it to a solid colour. Then set the blend mode to source atop. Then I add a sprite to that layer with the blend mode set to source out. What this does is cut holes out of solid colour to show what is below.

This maybe not the best way to do it as I found it by trial and error. So if anybody knows how to do it better then do let me know.

If anybody is interested I am using this technique to solve tile map gap problem when scaling. I basically fill a layer with the colour I want to appear in the gap. Then put the tile map on top. NICE!
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542

Post » Mon Sep 29, 2014 5:12 pm

Glad you found a solution, blends modes are great but tricky
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123


Return to Construct 2 General

Who is online

Users browsing this forum: lukewasthefish and 2 guests