Skip to content

Load a spritesheet with a texture_region map #291

@MichaelRijsdijk

Description

@MichaelRijsdijk

Enhancement request:

It would be an improvement to be able to import a spritesheet which can be cut into separate Sprites through code or with an included region information file. This would reduce the amount of I/O operations for setting up for example character animations. If the animation has 10 frames/Sprites you could load in one file and convert them into a list of Sprites through code.

What should be added/changed?

load_spritesheet -> can be as simple as loading an image
texture_region -> holds coordinate and size information for items in the loaded spritesheet.

Or maybe it would be possible to enhance the load_textures function with an extra option for a region description file.

Example basic:
A basic implementation could be a spritesheet image and a generate_textures with Sprite size which splits the image into Textures.

generate_textures(spritesheet, sprite_size)

Example advanced:
uiskin

uiskin.txt

Programs like TexturePacker create these kind of files where Sprites could have different sizes.

What would it help with?

Reduce I/O load
Reduce the amount of images
Most frameworks for games support this method of loading Sprites

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions