Sprite Masking?

This is the place to find out how to accomplish something specific with SM2.

Sprite Masking?

Postby hima » Mon Jan 03, 2011 2:30 pm

Is it possible to add mask to sprite created by SM2? Has anybody tried this yet?
hima
 
Posts: 37
Joined: Mon Jan 03, 2011 2:25 pm

Re: Sprite Masking?

Postby Little Angel » Mon Jan 03, 2011 2:36 pm

Can you describe in more detail what you are trying to do? What are you trying to mask and why? I'm not sure you can (Brady?), but if you tell us what your ultimate goal is we might have a suggestion or better working method.
Little Angel
 
Posts: 772
Joined: Thu Sep 02, 2010 10:23 pm

Re: Sprite Masking?

Postby hima » Fri Jan 07, 2011 2:57 am

Pretty much something like irregular shape bar or GUI. Like, a bar that is like rectangular bar, but the shape is a bit like half of the circle.

Something like actionscript3 mask like this

http://www.republicofcode.com/tutorials ... s3masking/

Thanks :)
hima
 
Posts: 37
Joined: Mon Jan 03, 2011 2:25 pm

Re: Sprite Masking?

Postby Little Angel » Fri Jan 07, 2011 3:17 am

Riiiiiight... You're talking about doing that on the fly with two images? I know masks and masking, but I didn't understand the context... Hmmm... worth thinking about...

<Little Angel goes off to think...>
Little Angel
 
Posts: 772
Joined: Thu Sep 02, 2010 10:23 pm

Re: Sprite Masking?

Postby Brady » Fri Jan 07, 2011 3:35 am

I've read about shaders, etc, that can be used to do something like this over at the Unity forums. They may or may not work well for SM2, but I think it's possible, but unfortunately I don't have much information on this at the moment. But if you search on the Unity forum, you should come up with some threads that may help answer this question.
Brady
 
Posts: 5361
Joined: Tue Jul 06, 2010 11:33 pm

Re: Sprite Masking?

Postby ibyte » Sat Jan 15, 2011 3:43 pm

I have a similar requirement. I want to have a sprite with a texture, where various parts of the texture get uncovered as the game progresses. Unless there is some other way I was thinking a shader would be the thing to look into.
ibyte
 
Posts: 258
Joined: Tue Sep 07, 2010 8:23 pm

Re: Sprite Masking?

Postby Brady » Sat Jan 15, 2011 9:53 pm

If you just need it to happen in a side-to-side linear fashion (think of a progress bar), then you can use one of the Truncate methods. But you probably need something more complex than a linear side-to-side sort of thing.
Brady
 
Posts: 5361
Joined: Tue Jul 06, 2010 11:33 pm

Re: Sprite Masking?

Postby ibyte » Sun Jan 16, 2011 2:34 pm

Hi Brady, yes it would be a 4 x 5 grid where two random sections at a time need to be uncovered.
ibyte
 
Posts: 258
Joined: Tue Sep 07, 2010 8:23 pm

Re: Sprite Masking?

Postby Little Angel » Sun Jan 16, 2011 3:18 pm

I'm just curious... ... ...

Why do you need to do this with an on the fly matte? Can't this be done with button objects? Each reveal being a button? I'm tring to think of why you'd need on the fly masking... Other than animated shape transitions.

Are you looking for non-rectangular animated shape transitions?
Little Angel
 
Posts: 772
Joined: Thu Sep 02, 2010 10:23 pm

Re: Sprite Masking?

Postby ibyte » Mon Jan 17, 2011 6:36 am

Little Angel wrote:I'm just curious... ... ...

Why do you need to do this with an on the fly matte? Can't this be done with button objects? Each reveal being a button? I'm tring to think of why you'd need on the fly masking... Other than animated shape transitions.

Are you looking for non-rectangular animated shape transitions?


Hi Little Angel,

I think the job could be done using a grid of 20 rectangular sprite objects. I was thinking of alternatives and wondered if a shader could be used instead.

iByte
ibyte
 
Posts: 258
Joined: Tue Sep 07, 2010 8:23 pm

Next

Return to SM2 How to...

Who is online

Users browsing this forum: No registered users and 27 guests

cron