Author Topic: Make UISprite black-and-white  (Read 7666 times)

elvess

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
Make UISprite black-and-white
« on: July 22, 2014, 04:18:41 AM »
Hello.
Im using UISprite to render sprites. I have two sprites that are in the same atlas.
Is there a way to make one of them black-and-white without creating additional textures?

Thank U
Paul

Yukichu

  • Full Member
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 8
  • Posts: 101
    • View Profile
Re: Make UISprite black-and-white
« Reply #1 on: July 22, 2014, 08:51:13 AM »
A lot of times I make my sprites black and white and add a tint via the widget to make them different colors as needed.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Make UISprite black-and-white
« Reply #2 on: July 22, 2014, 09:23:40 PM »
There is no way to make a colored sprite black-and-white in NGUI. You'd need to write a custom shader for something like that.

elvess

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
Re: Make UISprite black-and-white
« Reply #3 on: July 24, 2014, 04:01:42 AM »
Thank U.

We have shader that makes texture black-and-white. But shader is applying on material, and it will make all the sprites in atlas black-and-white. And I need to make only one sprite from atlas black-and-white.


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Make UISprite black-and-white
« Reply #4 on: July 25, 2014, 01:05:36 AM »
You can specify a material override on UITextures / UI2DSprites, but not on UISprites. My suggestion? Use Unity 4.5's 2D sprites instead of an NGUI atlas. You will be able to choose whatever material you want that way. ALT+SHIFT+D to add a 2D sprite.

elvess

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
Re: Make UISprite black-and-white
« Reply #5 on: July 25, 2014, 02:50:10 AM »
Thank U. Ill try