- Home /
Image for button programmatically
I have a few different images I want to put together to create a button programmatically. I see how to use an image from assets during design time, but I need to generate the image on the fly. How would I do that?
Comment
Answer by DaveA · Sep 12, 2012 at 01:45 AM
http://docs.unity3d.com/Documentation/ScriptReference/Texture2D.SetPixels.html
Create a Texture2D then the array of pixels (as Color or Color32) and manipulate as needed, then follow directions on that page to apply and set them.