Libgdx batch draw invisible texture

I have the following code:

batch.draw(this.getTexture(), getX(), getY(), getOriginX(), getOriginY(),
                getWidth(), getHeight(), 1, 1, this.getRotation(),
                getRegionX(), getRegionY(), getRegionWidth(), getRegionHeight(),
                false, false);

which should the texture, it is definitely not null, however it's invisible.

Because it is drawing the player i don't think it is outside of the view.

Upvotes: 0

Views: 123

Answers (1)

cokceken
cokceken

Reputation: 2076

Your regionWidth and regionHeight may be 0. Try the code below

batch.draw(this.getTexture(), getX(), getY(), getOriginX(), getOriginY(), 
    getWidth(), getHeight(), 1, 1, this.getRotation(), 
    getRegionX(),getRegionY(), getWidth(), getHeight(), false, false);

Upvotes: 1

Related Questions