thank you for this. as a person who is learning OOP and game dev I turned to Java and LibGDX as my first stop. this tutorial is really useful. thanks again :D
This is fantastic. I just finished a whole situation where I bought a top down rpg tile set that came to me in a single png file with all kinds of dead space and duplicates, so 1. Open the spritesheet image like normal 2. Use the grid and snap to grid for selection tool to select islands of tiles im interested in using 3. Once done, invert the selection, delete the rest 4. Convert the result into a named "Tileset" 5. Export the tileset as an minimized optimized tilesheet image file that ignores empty and duplicate tiles 6. File > Import > Import Sprite Sheet, choose my new tilesheet image, choose 16x16 7. hit "ok" and the whole thing gets imported as individual frames 8. file > export > export as, choose png with a name, hit ok Out of 1200+ possible exported tiles, I ended up with an optimized 270 individual tile images Now, what I did at this point in my gdx project, was glob the directory and instantiated a new Sprite for each image, loading each sprite into a global SpriteRegistry. This registry is a simple map array of string key -> sprite value, where the key is the file path. Querying to load a new sprite with that file path first checks the registry and if it’s already loaded and in memory, returns the sprite instance for usage. So now I can loop across my 4096 int long tile map and just query for each Sprite, set the x y and add it to the one big batch for tile rendering. For 16x16 tiles, the whole thing is damn near instant, and the frame rate is still delicious But now I’m thinking about this atlas…
The difference between a Atlas and Tiles is that a Atlas is a full sheet of an image, while a Tiled is similar, but is more like a map. I can probably do a tutorial video for that if you want?
Hello, yes for packing the sprite sheet into a atlas format you need the GDX Texture Packer. Unfortunately you probably have to add each sprite texture in order for it to create a new atlas and sprite sheet with the correct coordinates. If you need more help just let me know.
thank you for this. as a person who is learning OOP and game dev I turned to Java and LibGDX as my first stop. this tutorial is really useful. thanks again :D
Yes you're welcome, keep learning that is for sure. I hope to provide more content to help as much as possible. Your welcome.
Thank you too much bro, i am from argentina and you content its too useful here. I wish you luck
Thanks you, and you too. I will try to keep posting content.
This is fantastic.
I just finished a whole situation where I bought a top down rpg tile set that came to me in a single png file with all kinds of dead space and duplicates, so
1. Open the spritesheet image like normal
2. Use the grid and snap to grid for selection tool to select islands of tiles im interested in using
3. Once done, invert the selection, delete the rest
4. Convert the result into a named "Tileset"
5. Export the tileset as an minimized optimized tilesheet image file that ignores empty and duplicate tiles
6. File > Import > Import Sprite Sheet, choose my new tilesheet image, choose 16x16
7. hit "ok" and the whole thing gets imported as individual frames
8. file > export > export as, choose png with a name, hit ok
Out of 1200+ possible exported tiles, I ended up with an optimized 270 individual tile images
Now, what I did at this point in my gdx project, was glob the directory and instantiated a new Sprite for each image, loading each sprite into a global SpriteRegistry. This registry is a simple map array of string key -> sprite value, where the key is the file path. Querying to load a new sprite with that file path first checks the registry and if it’s already loaded and in memory, returns the sprite instance for usage.
So now I can loop across my 4096 int long tile map and just query for each Sprite, set the x y and add it to the one big batch for tile rendering. For 16x16 tiles, the whole thing is damn near instant, and the frame rate is still delicious
But now I’m thinking about this atlas…
Good video
Awesome to know about this texture packer!
Glad you like it!
You deserve a billion subscribers
Aw thank you, I will keep producing content and tutorials for all. New video coming out soon.
Thanks, Incredibly Helpful.
Thank you.
Nice
what's the difference between textureAtlas and Tiled? Or are they two different things?
great series btw !!
The difference between a Atlas and Tiles is that a Atlas is a full sheet of an image, while a Tiled is similar, but is more like a map. I can probably do a tutorial video for that if you want?
@@PhilipModDev if you could, that'd be extremely helpful!!
Hallo, i have a spritesheet, but have not a *.atlas file, how can i make correct atlasfile?
Hello, yes for packing the sprite sheet into a atlas format you need the GDX Texture Packer. Unfortunately you probably have to add each sprite texture in order for it to create a new atlas and sprite sheet with the correct coordinates. If you need more help just let me know.