I'm trying to draw a Sprite
in LibGDX. I can do it if I use a constructor that specifies a texture to use, such as
Sprite sprite = new Sprite(new Texture(Gdx.files.internal("path")));
but if I instead use Sprite();
and try to then use setTexture
and/or setRegion
, no picture is drawn. The API says that a "texture, texture region, bounds, and color" need to be set before anything can be drawn. I've made calls to setTexture
, setRegion
, and setColor
although nothing is being drawn.
Main question: If I use the default Sprite()
constructor, what do I have to do afterwards to make sure it draws to the screen (in a SpriteBatch
)?