Hello Guest

Author Topic: How to Whiten a Sprite Gradually  (Read 5951 times)

ExCx

  • Newbie
  • *
  • Posts: 10
    • View Profile
How to Whiten a Sprite Gradually
« on: September 19, 2013, 02:12:50 pm »
Hi, I need to make a sprite go completely white. I mean like a white silhouette of itself. I can change the shader to do it instantly, but how can I do it gradually?

marcosramos

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: How to Whiten a Sprite Gradually
« Reply #1 on: September 19, 2013, 09:57:17 pm »
This is somehow what i want to know as well.

profanicus

  • 2D Toolkit
  • Full Member
  • *
  • Posts: 167
    • View Profile
Re: How to Whiten a Sprite Gradually
« Reply #2 on: September 19, 2013, 11:37:57 pm »
I think you would need to make a custom shader.

You could copy and change an existing tk2d shader so that the vertex colour is added instead of multiplied. Your sprite colours would then need to be black instead of white by default to be in their 'normal' state. Then when you lerp the tk2d sprite colour to white, the sprite pixels should move towards a solid white instead of being tinted. That's my theory anyway. :)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How to Whiten a Sprite Gradually
« Reply #3 on: September 19, 2013, 11:53:20 pm »