- Home /
Create sprite or texture from list of Vector2
Kind of a weird question, but I can't find anything on it (could just be searching the wrong things). Basically I am giving the user the ability to "draw" a texture by selecting points on the screen. Once they have selected the points I want to make a sprite or a texture out of it to use throughout the game, but I can't figure out what to use for it.
Thank you in advance for any help!
well i am not sure how exactly you want ot draw the texture but you can create the texture but you could do somthing like this
var texture = new Texture2D(2, 2, TextureFormat.ARGB32, false);
// set the pixel values
texture.SetPixel(0, 0, Color.black);
texture.SetPixel(1, 0, Color.white);
texture.SetPixel(0, 1, Color.white);
texture.SetPixel(1, 1, Color.black);
this will create a texure half blacn and half white, you can create bigger textures and write pixel by pixel
Your answer
Follow this Question
Related Questions
Combine Array of Sprites to Form One Sprite 0 Answers
Reference Specific Sprites from Atlas 1 Answer
iOS crash with "Memory pressure" error - too many sprites? 0 Answers
Unity change my color variation?? 0 Answers
Loading a Sprite (Unity 4.3) in resource folder and setting it in sprite renderer 6 Answers