Masking a sprite...

Get help using Construct 2

Post » Thu May 30, 2013 4:27 pm

I've seen a few things about it but nothing really covers it exactly.

What I would like to do is fairly simple I think. I just want a sprite that is invisible to the player...completely invisible. But when you mouse over the sprite, for example with an alpha mask attached to the mouse it's revealed.

Tried this a few times by messing with the C2 lighting example but unless I'm trying to make a sniper scope I'm not seeing how to do this properly...if at all.

Any ideas?

B
19
S
7
G
10
Posts: 82
Reputation: 4,996

Post » Thu May 30, 2013 4:35 pm



Set your Sprite Opacity to 0

Event > Cursor is over "sprite"
Action > Sprite Opacity = "100"

??

B
9
S
3
G
1
Posts: 112
Reputation: 1,827

Post » Thu May 30, 2013 4:39 pm

Thanks but that's not quite what I mean, it needs to be alpha masked. That would just reveal the entire sprite.
B
19
S
7
G
10
Posts: 82
Reputation: 4,996

Post » Thu May 30, 2013 4:43 pm

Uhm, wut? Alpha Masked? Tell me when this problem is solved, this is interesting.
HARMLESS SIGNATURE THAT IS VIEWED BY OTHERS AS OFFENSIVE AND CONTROVERSIAL
B
14
S
3
G
3
Posts: 356
Reputation: 4,377

Post » Thu May 30, 2013 4:46 pm

Seek and ye shall find... an answer.
B
57
S
15
G
11
Posts: 912
Reputation: 12,586

Post » Thu May 30, 2013 5:18 pm

I've seen that, but I just don't get how to apply it to what I want =\

Thanks though.

This is about as close as I can get: Example

As you can see it's pretty much the opposite of what I want!

Except I want the red square to be completely invisible, the mask invisible as well. But when the mask goes over the red square you can see it through the mask.

Feel like I'm close but I'm not sure what else to try.
B
19
S
7
G
10
Posts: 82
Reputation: 4,996

Post » Thu May 30, 2013 5:27 pm

put the red square on your bottom layer

set your top layer transparency to "No"
And that should work ^^
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
44
S
18
G
18
Posts: 2,108
Reputation: 16,465

Post » Thu May 30, 2013 5:52 pm

That works thanks but it gives the same result as the lighting demo in C2.

In my project the top layer HAS to be transparent or it's not much use. Otherwise I would just be covering up backgrounds and other objects in my game. My posted .capx was just a basic example of the effect I'm after.

Basically what I need is an invisible mask, to reveal an invisible sprite, with full on layer transparency. Oi, I'm getting a headache dealing with all these blend modes.

Thanks for the help so far though everyone :)
B
19
S
7
G
10
Posts: 82
Reputation: 4,996

Post » Thu May 30, 2013 5:54 pm

maybe having another layer on top of all of these, which is transparent (I don't see myself another solution, but it should exists)

EDIT: maybe the example inside C2 can help you, it is called Blend modes I think (it is a example template which can be loaded in a new project, just to see)Aphrodite2013-05-30 17:58:12
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
44
S
18
G
18
Posts: 2,108
Reputation: 16,465

Post » Fri May 31, 2013 1:46 am

Thanks that was helpful.

So I learned that if I turn off the blending mode for the red square and set the mask to destination in, it...sort of works. But same problem as before, the red square is still always visible.

If I could just get the red square to be invisible now I would have it.

Updated capxKazan2013-05-31 01:48:45
B
19
S
7
G
10
Posts: 82
Reputation: 4,996

Next

Return to How do I....?

Who is online

Users browsing this forum: Benjo11, dzert14, imhotep22, mdvgames, yodashii and 2 guests