1

I'm trying to load a TextureRegion from my TextureAtlas. However, it's loading the whole TextureAtlas instead of just the subimage.

The issue is similar to this question but I'm not calling sprite.getTexture(), yet I'm getting the same problem.

TextureAtlas atlas;     
oceanTextureRegion; 

atlas = new TextureAtlas(Gdx.files.internal("atlas.txt"));
oceanTextureRegion = atlas.findRegion("ocean");

in render method...

batch.draw(oceanTextureRegion, 0, 0);
Community
  • 1
  • 1
Bilal
  • 13
  • 3

1 Answers1

0

Obviously you have wrong region uv scale & position in atlas.txt pack file, or you have changed the oceanTextureRegion UV position to larger values, notice if you change UV Position of region then it takes other part of images.

daniel
  • 697
  • 5
  • 15