1
\$\begingroup\$

I have a TextureRegion that I get from an atlas map (which in turn I get from the Asset Manager), eg

AssetManager am = myGame.getAssetManager();
TextureAtlas atlas = am.get("my.atlas", TextureAtlas.class);
TextureRegion object = atlas.findRegion("myobject");

Now when I draw the object with

batch.draw(object, ...);

the object is drawn correctly, but if I do

batch.draw(object.getTexture(), ...);

it is drawn as garbage. Is this expected? I thought it should work the same.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

Ok, problem solved. Trying with bigger objects from the same texture atlas, I see that getTexture() actually returns the whole atlas image, and this is by design, see eg this question

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .