0
votes

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.

1
Did you set x,y,width,height ?cokceken
Yes i did set them in the constructorБлаговест Тодоров
What are rotation, regionx, regiony etccokceken
If you are using a simple structure what does batch.draw(getTexture(), getX(), getY(), getOriginX(), getOriginY(), getWidth(), getHeight()); producecokceken
with little tweaks it shows, however i need to apply rotation somehow to the batchБлаговест Тодоров

1 Answers

1
votes

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);