reverse mask

For questions about using Classic.

Post » Wed Mar 11, 2009 12:24 am

I have a feeling the answer may end up being obvious, is there an effect or a technique to do the opposite of what mask does, only reveal a certain part of the layer, because, for now, if I want to reveal only a small circle of a layer using a mask, I need to use a huge transparent png that takes up the whole screen with a small circle in the middle of it. is there an easier way?
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Wed Mar 11, 2009 12:52 am

Try removing the transparency check from the layer that you're doing this on in layer properties. (I think that's how you do it) alternatively look at the Lighting Effects tutorial in the Tutorial section.
B
2
S
2
G
4
Posts: 136
Reputation: 1,722

Post » Wed Mar 11, 2009 12:57 am

Try the 'erase' effect?
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Wed Mar 11, 2009 7:56 pm

thanks for the suggestions guys
but neither is exactly what I meant
let's say you have a background
and you want to see the whole background at all times

on top of the background (on the next layer) you have a sprite of a ghost and a circle
you don't want to see the circle, but you want to use the circle as a mask to reveal the ghost
so the ghost is invisible except for parts that are overlapped by the circle

I can do this by making a huge transparent square sprite with an opaque circle in the middle and using mask, or a huge opaque square sprite with a transparent circle in the middle using erase. I'm trying to figure out a combination of layer and sprite effects, where I can just have the circle by itself, without needing a huge square around it. even if I need a huge square sprite I have to reuse, I don't mind. I just want the circle I'm using as a mask to be separate from the huge square, so I can move it and reshape it freely without worrying about whether the square is covering the rest of the screen.
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Wed Mar 11, 2009 10:18 pm

Why don't you just crop the circle?
If you open the image up in the editor, then hit crop at the top it will do that for you.
You can then set the circle wherever you want, or use events to set its x,y.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Thu Mar 12, 2009 12:16 am

[quote="newt":3uq9sdhl]Why don't you just crop the circle?[/quote:3uq9sdhl]

I need the huge square to mask the rest of the screen. I don't want to see anything except for what's behind the circle. if I crop the circle, it won't hide the background. here I posted a cap to show the problem:



move around sprite3, so you can see what I mean. I want the pink square to only be revealed by the circle. I realize I could've made sprite three bigger, but that's what I'm trying to avoid. if I would have cropped it, it really wouldn't work at all. this cap also let's you see how distracting and difficult it is to move around an invisible mask with a huge border. I plan to have many on screen at once to create a variety of effects.
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Thu Mar 12, 2009 1:59 am

Is this the effect you're going for?

http://willhostforfood.com/?Action=down ... leid=58459

Because it does this:
[quote="Ashley":1id8eitx]Try the 'erase' effect?[/quote:1id8eitx]

And this:

[quote="newt":1id8eitx]Why don't you just crop the circle?
If you open the image up in the editor, then hit crop at the top it will do that for you.
You can then set the circle wherever you want, or use events to set its x,y.[/quote:1id8eitx]
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu Mar 12, 2009 2:12 am

[quote="deadeye":3i42skk9]Is this the effect you're going for?[/quote:3i42skk9]

not quite
this is the effect I'm going for

only without cheating by having a clone of the background.
if I had a bunch of sprites and things animating behind this layer, I would still want it to work, so the method I used in this cap won't due. But it shows the effect I'm going for
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Sat May 09, 2009 11:22 am

Thread Revival!

Does Construct use RGBA for the framebuffer? that is, is there a destalpha?
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Sat May 09, 2009 1:57 pm

When rendering to a layer texture, yes (ARGB format), but when rendering to the backbuffer/display, no (XRGB format, A is ignored).
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests