class SFML::TextureAtlas

A sprite-sheet plus a frame-name → rectangle index. Loads the JSON descriptors that Aseprite and TexturePacker export — both use the same frames + meta shape, just with a few field differences we paper over.

atlas = SFML::TextureAtlas.load(“hero.json”)

atlas.texture #=> SFML::Texture atlas.region(“hero-walk-0”) #=> SFML::Rect atlas.frame_names #=> […] atlas.sprite(“hero-walk-0”) #=> ready-to-draw SFML::Sprite atlas.duration(“hero-walk-0”) #=> Integer ms (Aseprite only)

The image path inside the JSON is resolved relative to the JSON file’s directory. Override with image: "path/to/img.png".

Frame lookups are tolerant of the .png extension — Aseprite exports walk-0.png, but you can write atlas.region("walk-0").