Help with AtlasTexture.tres

AnomaexAnomaex Posts: 7Member
edited February 15 in 2D

Hello everyone, I need help understanding AtlasTexture.tres..


For starters, my version of how I understand :) .

  • 1) I started learning Godot after Unity. In Unity, I did it simply, from one image that has all the parts of different 2D objects in it, in the Unity import settings I cut this image into small parts (selected multiple), and I got several sprites that I could pull onto the scene and work with them.
  • 2) In Godot, I import a file, and I don’t find in the import to cut the picture into small sprites.
    Then I see that I can create name_atalstexture.tres and put in the Atlas column my picture that I imported.
    In the TextureRegion window, I select only one area, and it will be shown in the scene if I put this name_atalstexture.tres in the sprite component on scene.

  • 3) And here a question appears! :/
    How can I cut out a few objects in this name_atalstexture.tres and drag them out onto the scene? :/
    At the moment, I understand only one thing, that I need to create such files(name_atlastexture.tres) for each object that I want to cut from my image that I imported. Right? :s


UPD: I learned about TexturePacker download it and disappointment came over me, To use the Godot SpriteSheet plugin in TexturePacker, you need to purchase the Pro version... here it is, ship.. like stinky Unity... :'(


Tags :

Best Answer

  • AnomaexAnomaex Posts: 7
    edited December 2019 Accepted Answer

    @klaas said:
    in the sprite you can crop a region of a image to display
    .........

    I tried. Cool theme!
    But, here no opportunity animate these separately cut objects....... :s

    And the only universal way remains TextureAtlases.tres =)

Answers

  • klaasklaas Posts: 13Member

    Hi Anomaex
    maybe you want to have a look at the sprite3D/2D object.

    With Vframes and Hframes you determine the row and column count of yout sprite sheet
    Frame is the current visible sprite on the sheet

    So you can duplicate the sprite and change the frame index

    TextureAtlases are mainly used in 3D texturing for objects with many textures (like terrains). You can reduce draw counts or texture usage to speed up rendering. But that isnt a trivial thing to do.

    Hope it helps ... have fun

  • cyberealitycybereality Posts: 561Member

    It depends what you are trying to accomplish. For a character, or really any animating object, you can use an AnimatedSprite, which allows you to import 1 big image with a grid of sprite frames. See here for some assistance.
    https://docs.godotengine.org/en/3.1/tutorials/2d/2d_sprite_animation.html
    If you are working with a level floor or platforms, you would use a TileMap. See here:
    https://docs.godotengine.org/en/3.1/tutorials/2d/using_tilemaps.html

  • AnomaexAnomaex Posts: 7Member

    @klaas said:
    Hi Anomaex
    maybe you want to have a look at the sprite3D/2D object.
    .........

    Thanks for the information about the functionality of the sprite, I didn't know about it! =)
    But this method has disadvantages:
    In this case, you need to make an even grid on the atlas for setting Vframes and Hframes and put all the objects exactly in the grid, but if for example we need small objects among large ones on the atlas..., in this case there is a consumption of free space on the atlas image.
    This is good for some kind of animations, and not just objects that you would like to cut.
    Without a doubt, the information useful.

  • AnomaexAnomaex Posts: 7Member

    @cybereality said:
    It depends what you are trying to accomplish. For a character, or really any animating object, you can use an AnimatedSprite, which allows you to import 1 big image with a grid of sprite frames. See here for some assistance.
    ......

    Thanks for the answer. :)
    As I wrote above, this is only good for atlases that are split into even meshes.
    And in turn, this is great for animations or objects that are the same size in the atlas.

    But, if we have just such an atlas, an example.

    Then there will already be problems since we don’t have a uniform grid, and the need to cut the hands of the objects that are needed.

    At the moment I see only the option with TextureAtlases, since you need a bunch of objects of different sizes in one atlas, it was possible to cut them depending on the size of the object, rather than a uniform grid. =)

  • klaasklaas Posts: 13Member

    in the sprite you can crop a region of a image to display

    you have to enable region and enter the cropping rect values in pixel dimensions

  • AnomaexAnomaex Posts: 7Member
    edited December 2019 Accepted Answer

    @klaas said:
    in the sprite you can crop a region of a image to display
    .........

    I tried. Cool theme!
    But, here no opportunity animate these separately cut objects....... :s

    And the only universal way remains TextureAtlases.tres =)

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file