Java Game Development (Libgdx) TextureAtlas

Поделиться
HTML-код
  • Опубликовано: 17 ноя 2024

Комментарии • 18

  • @starstuff606
    @starstuff606 29 дней назад +2

    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

    • @PhilipModDev
      @PhilipModDev  29 дней назад +1

      Yes you're welcome, keep learning that is for sure. I hope to provide more content to help as much as possible. Your welcome.

  • @ianvila
    @ianvila Месяц назад +3

    Thank you too much bro, i am from argentina and you content its too useful here. I wish you luck

    • @PhilipModDev
      @PhilipModDev  Месяц назад +2

      Thanks you, and you too. I will try to keep posting content.

  • @KyleHarrisonRedacted
    @KyleHarrisonRedacted 6 месяцев назад +2

    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…

  • @Biscuit_MCYT
    @Biscuit_MCYT 11 месяцев назад +4

    Good video

  • @leonidasbrockweld2698
    @leonidasbrockweld2698 10 месяцев назад +1

    Awesome to know about this texture packer!

  • @nedstarkx5637
    @nedstarkx5637 Месяц назад +1

    You deserve a billion subscribers

    • @PhilipModDev
      @PhilipModDev  Месяц назад +2

      Aw thank you, I will keep producing content and tutorials for all. New video coming out soon.

  • @tarahiwebsite9664
    @tarahiwebsite9664 8 месяцев назад +1

    Thanks, Incredibly Helpful.

  • @CubusStudios
    @CubusStudios 11 месяцев назад +2

    Nice

  • @hulium
    @hulium 3 месяца назад +2

    what's the difference between textureAtlas and Tiled? Or are they two different things?
    great series btw !!

    • @PhilipModDev
      @PhilipModDev  3 месяца назад +3

      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?

    • @hulium
      @hulium 3 месяца назад

      @@PhilipModDev if you could, that'd be extremely helpful!!

  • @andrejklester5851
    @andrejklester5851 6 месяцев назад +1

    Hallo, i have a spritesheet, but have not a *.atlas file, how can i make correct atlasfile?

    • @PhilipModDev
      @PhilipModDev  6 месяцев назад +2

      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.