I am using Texture packer libgdx texture packer
for my libgdx game . I have created pack file also . now I have one balloon_burst_pack.png and one
balloon_burst_pack.pack file.
only thing is from online documentation I cant figure out how exactly should i retrieve all 15 png images from pack file.
my image names are like balloon_color_0001.png, balloon_color_0002.png which I have packed in one balloon_packed.png
small code i have tried is :
atlas = new TextureAtlas(Gdx.files.internal("Animations/balloon_color_pack/balloon_burst_pack.pack"));
for (int i = 0; i< 15;i++ ) {
region[i] = atlas.findRegion("balloon_colour"+"000"+i);
System.out.println("region detected is"+region[i].getRegionX());
}
anyone who have used same texture packer please give me reference to use packed file . please explain me step by step if possible..
Thanks.
The problem with your png names is that texture packer trims all names after first '_' so you must change the names of your png to something like ballooncolor_0001.png, ballooncolor_0002.png etc insted of balloon_color_0001.png etc then use kumar saurabh's code to load all the file
or eith current setup you can use name as balloon instead of ballon_color