2D Toolkit Forum

2D Toolkit => Support => Topic started by: Lrateke on December 07, 2013, 04:17:28 am

Title: How to change the alpha of a "Sprite from texture".
Post by: Lrateke on December 07, 2013, 04:17:28 am
I'm using a whole texture as a background using "Sprite from Texture" for my game and one thing I want to make is change the alpha of the sprite - like darkening it or making it invisible. How can I make that?
Title: Re: How to change the alpha of a "Sprite from texture".
Post by: unikronsoftware on December 07, 2013, 02:52:55 pm
After its created, you'll see a sprite component on there. You can adjust the sprite alpha to modify it.
Title: Re: How to change the alpha of a "Sprite from texture".
Post by: Lrateke on December 07, 2013, 03:14:51 pm
Well I tried, but I'm not finding. I tried to change the material to some of those that have "Transparency" but all of then darken the sprite, witch is something that I don't wish too. Also I want to change the alpha slowly on an animation, and I can't find a way...
Title: Re: How to change the alpha of a "Sprite from texture".
Post by: unikronsoftware on December 07, 2013, 03:19:15 pm
You can't do it with the unity animation system. It doesn't work with properties.
I recommend using a tween package to do that - HOTween for example, works beautifully.
Title: Re: How to change the alpha of a "Sprite from texture".
Post by: Lrateke on December 07, 2013, 03:33:45 pm
Thank you...

I've figured it out - After learning how to make it was pretty easy actually.
Title: Re: How to change the alpha of a "Sprite from texture".
Post by: DemiGoth on February 26, 2014, 07:38:14 am
Thank you...

I've figured it out - After learning how to make it was pretty easy actually.

Care to share your solution? I'm in need of some alpha transforming as well ;)

[EDIT]

Found it myself as well -> myObject.color= new Color32(0,0,0,128); // Black & half-transparent Using it to gray-out non essential menu objects....