Author Topic: A changeable mask  (Read 2871 times)

afrokick

  • Newbie
  • *
  • Thank You
  • -Given: 4
  • -Receive: 0
  • Posts: 6
    • View Profile
A changeable mask
« on: September 12, 2014, 08:00:08 AM »
I need to implement a mask similar to a Flash's mask. Our artist should be able to rotate, scale and move this mask. I found a simple Mask Shader created by Niki. Sure, I can change texture's offsets, but I cannot rotate and scale this texture.

For this reason, I started implement a custom component(UIMask), which contains two UISprite-s(mask,sprite). But now I have questions.

Is it possible to make it only in one mesh, or I need to create another mesh?
How find an overlap of two sprites and draw only it?

I think that this component will be very useful for many developers)

Sorry for my bad english.

badawe

  • Jr. Member
  • **
  • Thank You
  • -Given: 8
  • -Receive: 7
  • Posts: 70
    • View Profile
Re: A changeable mask
« Reply #1 on: September 12, 2014, 09:36:26 AM »
I guess do you want to do something like the stecil here right:

https://www.youtube.com/watch?v=5wcODp8Sh8o

have not a single clue of how do that with NGUI :P

afrokick

  • Newbie
  • *
  • Thank You
  • -Given: 4
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: A changeable mask
« Reply #2 on: September 15, 2014, 12:35:31 AM »
badawe, yes, you're right.