Masking Help

For questions about using Classic.

Post » Tue May 19, 2009 5:04 am

Hi guys me again, haven't been on here for a while.
But I'm back into the construct and I'm wondering if it is possible to use one sprite as a mask for another sprite without using different layers?

I'm pretty sure there is but I'm quite rusty at the moment

:D
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Tue May 19, 2009 8:37 am

I'm pretty sure it is possible. Just be aware of the Z-ordering; mask has to always be above sprite.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Tue May 19, 2009 8:38 am

Yeah, I dunno how to do it though
i completely forgot all my masky stuff

And don't get me started on Z order's lol, i'm STILL having problems with my ISO engine with Z orders
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Tue May 19, 2009 8:53 am

1. Create a sprite
2. Name it Mask
3. Add "Erase" effect to it
4. Doodle in the sprite (a smiley or something)
5. Right click the Mask, Order, To Front (this will bring it in front of other sprites)
6. Tick "Force own texture" in layer properties
7. Move the Mask over other sprites and glee.

Nothing wrong with using layers, though. They cost nothing :P
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Tue May 19, 2009 9:01 am

I'll give that a go in a sec

the reason i can't use layers for this is cause this masking thing is for a shadow idea for my iso engine and i'll need to Z layer the masks on the same layer as the playfield

I might actually start another thread to see if people can help with my Z sorting problem although i've done that before and i still couldn't fix it :(

anyway thanks for your help
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Tue May 19, 2009 9:11 am

Sorry to be a pain, that gave a similar result to what i wanted

What i need is a sprite that acts as a mask for another sprite so that when they overlap the sprite becomes visible, rather than having the mask make it invisible

hard to explain. it may not be possible considering my constraints, just an idea i wanted to try out anyway
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Tue May 19, 2009 10:59 am

Cant you just have it change opacity when it overlaps?
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Tue May 19, 2009 11:05 am

not quite, the whole idea is to have a portion of an invisible sprite visible when it is overlapping the mask object.

changing the opacity would affect the entire sprite rather than just showing a portion of it

it's ok if it's not possible, it was just an idea i was entertaining
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Tue May 19, 2009 11:25 am

Well you could add an animation.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Tue May 19, 2009 11:29 am

um not really
I need it to be a little more dynamic then that, the sprite is essentially controlled by the player and parts of it need to be visible when they're overlapping the mask object.
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests