Is there a way I can use SetPixel, to display text on a texture2d. Well I could design something to read sample textures with just letters and clear pixels then copy onto the texture letter by letter. But there must be an easier way something maybe similar to how the GUI shows text.
Any help would be greatly appreciated.
Thank You
TWest
Have the text render on a camera that uses a render texture target with all others having the guilayer disabled, then use readpixels to get it from there into a texture and then transfer it from there to wherever you want through setpixel that would work
How could i access this render texture that the camera uses?
I was looking at using a GUIText and redirecting the renderer to the Texture2D I needed. But I am having issues creating one through script, does anyone know its constructor. I am getting a null reference when i try to set text.
Thank You
Troy West
You mean the constructor for Texture2D? You just need to pass the width and height of the texture you want:-
var tex = new Texture2D(256, 512);