- Home /
Question by
ToeBeanGames · Sep 14, 2014 at 12:20 AM ·
texture2dtint
Change Texture2D tint (C#)
What I have is a white vignette set up as a Texture2D and a public Color variable called VignetteColor. I need to be able to change the vignette's tint. How can this be done?
(The only script I have so far is to show the vignette so I doubt it'll be any help.
Comment
Best Answer
Answer by bilo-lwabona · Sep 14, 2014 at 07:55 PM
If you are showing the Vignette in Unity's OnGUI() function, then you can set the tint color using GUI.color = Vignette color. Just make sure to reset the color to white straight afterwards:
GUI.color = VignetteColor;
GUI.DrawTexture(RectToDisplay, VignetteTexture);
GUI.color = Color.white;
Hope that helps. Also, it is always a good idea to provide some code, so others have something to work with when providing solutions. Hope this helps.