Help with Draw.Texture examples
I'm unclear about how to use Draw.Texture. I'd like to array the same texture (or tile) to create a specific line type.
This Renders 1 Texture :
Sprite sprite = Resources.Load(spritePath) as Sprite;
Draw.Texture(sprite.texture, new Vector2(1, 1), .25f);
This Renders Nothing :
Draw.Texture(sprite.texture, new Vector2(1, 1), .25f);
Draw.Texture(sprite.texture, new Vector2(2, 2), .25f);
This Also Renders Nothing:
for (int i = 0; i < 10; i++)
{
Sprite sprite = Resources.Load(spritePath) as Sprite;
Draw.Texture(sprite.texture, new Vector2((float)i, 1), .25f);
}
I saw a post about using the Rect overload for setting uvs, but haven't had any luck on my own. Any help would be greatly appreciated.
what's the surrounding context? did you set up the draw command properly, and are you calling it in a valid part of the render pipeline?
There's lots of info on that in the docs on immediate mode. You'll also need to have [ExecuteAlways] if you expect it to show up without hitting play.
also make sure the texture isn't null.
if all else fails, it's possible the shader cache might be broken, and you'll have to do a clean reinstall: https://shapes.userecho.com/knowledge-bases/2/articles/290-how-to-do-a-clean-reinstall-of-shapes