Hi guys! I have a little big question about TextureAtlas and the soft TexturePacker.
First of all, I created 4 simple images, all same size. Put them into the TexturePacker and configured it to work with libGDX. The first thing is that one of the 4 images show up rotated into the atlas (to gain space?) Anyway, I keep going with this tutorial: http://bitiotic.com/blog/2012/05/10/tutorial-for-texturepacker-and-libgdx/
So…I publish de atlas, get the 2 files and then inside libGdx:
atlas= new TextureAtlas(Gdx.files.internal("assets/atlas_test/pack1.txt"));
fig1= atlas.findRegion("fig1");
fig2= atlas.findRegion("fig2");
fig3= atlas.findRegion("fig3");
fig4= atlas.findRegion("fig4");
And the render method:
batch.begin();
batch.draw(fig1, 0, 200);
batch.draw(fig2, 0, 400);
batch.draw(fig3, 200, 400);
batch.draw(fig4, 200, 200);
batch.end();
The output:
http://s24.postimg.org/o4im29lhx/screen.png
Not so cool, uh? i can understand that the packer rotates images to gain space but…when I load them I wanted without rotation!
This is the .txt generated by the TexturePacker:
pack2.png
format: RGBA8888
filter: Linear,Linear
repeat: none
fig1
rotate: true
xy: 2, 145
size: 151, 141
orig: 151, 141
offset: 0, 0
index: -1
fig2
rotate: false
xy: 308, 2
size: 151, 141
orig: 151, 141
offset: 0, 0
index: -1
fig3
rotate: false
xy: 155, 2
size: 151, 141
orig: 151, 141
offset: 0, 0
index: -1
fig4
rotate: false
xy: 2, 2
size: 151, 141
orig: 151, 141
offset: 0, 0
index: -1
Seems to be fine but the “findRegion” method just check the name and returns the region. It doesn’t care about rotation. I don’t know…Im doing something wrong?