Author Topic: Is it possible masking sprites by creating a shader.  (Read 3547 times)

gouzhun

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 2
    • View Profile
Is it possible masking sprites by creating a shader.
« on: October 06, 2014, 02:32:29 AM »
Hi,I've searched all the forum topic, I know that sprite can not be masked and
UIPanel texture based clipping can not solved my problem.
My situation is :
1. UISprite icon represent weapon fragment which is a weapon icon with masked part.
2. Can't use UIPanel texture mask, because in bag, not just weapon fragment, but also
    Weapon, potion, cloth...
3. I have not only one mask type texture, so I can not put the mask data on the sprites
    texture's alpha channel.
4. Considered using UITexture, but worry about the performance.

So anybody has a solution for me,will really appreciate it. thanks~~ :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Is it possible masking sprites by creating a shader.
« Reply #1 on: October 06, 2014, 10:22:05 AM »
Use UITexture. There is no performance difference, you will just create 1 extra draw call, but that's it.