How do I hide part of a sprite?

Get help using Construct 2

Post » Sun Feb 18, 2018 4:29 pm

In html you can hide parts of an image using overlay. I'm wondering if a similar thing is possible in Construct 2.
I want to be able to make a hole in a sprite without using colours (Since it would be visible due to the background in the game).

What I'm asking is, is there some kind of effect that can be added to an object to make it hide objects on the same layer as it when they cross.
B
5
S
1
Posts: 22
Reputation: 424

Post » Mon Feb 19, 2018 12:50 am

You can do this using blend modes.
Put two sprites (main sprite and the black "hole" sprite) on the same layer, set "Force own textures" in this layer's properties. And apply Destination Out blend mode to the "hole" sprite.
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
17
S
9
G
156
Posts: 2,209
Reputation: 82,999

Post » Fri Mar 09, 2018 7:28 am

dop2000 wrote:You can do this using blend modes.
Put two sprites (main sprite and the black "hole" sprite) on the same layer, set "Force own textures" in this layer's properties. And apply Destination Out blend mode to the "hole" sprite.


I tried your solutoin but it didnt work.
Image
B
86
S
31
G
2
Posts: 131
Reputation: 8,405

Post » Fri Mar 09, 2018 9:02 am

You should try again, because it does work. Make sure the "hole" sprite is on top of the main sprite. And both sprites are not on the bottom layer.
how-do-i-reduce-the-energy-bar_p1140329?#p1140329
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
17
S
9
G
156
Posts: 2,209
Reputation: 82,999

Post » Fri Mar 09, 2018 9:36 am

dop2000 wrote:You should try again, because it does work. Make sure the "hole" sprite is on top of the main sprite. And both sprites are not on the bottom layer.
how-do-i-reduce-the-energy-bar_p1140329?#p1140329


I tried but didnt work.
here is sample
https://www.dropbox.com/s/g1ho6alsc7nv7 ... .capx?dl=0
Image
B
86
S
31
G
2
Posts: 131
Reputation: 8,405

Post » Fri Mar 09, 2018 9:44 am

Both sprites should be on the same layer, mask sprite should be above the pink square, mask sprite should have "Destination out" blend mode.
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
17
S
9
G
156
Posts: 2,209
Reputation: 82,999


Return to How do I....?

Who is online

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