Hello Guest

Author Topic: how to set color for sprite?  (Read 3669 times)

vivaldi

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 15
    • View Profile
how to set color for sprite?
« on: October 09, 2013, 06:16:57 pm »
I try to change sprite color:
sprite.color = new Color(71,71,71,1);
but it's doesn't work.
How can I change sprite color?
Thanks

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: how to set color for sprite?
« Reply #1 on: October 09, 2013, 06:18:12 pm »
You should refer to the docs for Color, the range is 0..1 not 0..255.

vivaldi

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: how to set color for sprite?
« Reply #2 on: October 09, 2013, 06:35:39 pm »
ok, Thanks, i missed this.

But how can I make sprite grayscale?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: how to set color for sprite?
« Reply #3 on: October 09, 2013, 07:14:19 pm »
You cant. You'll have to use a shader for that.