{"id":16186896,"url":"https://github.com/robloach/raylib-aseprite","last_synced_at":"2025-04-09T07:07:35.763Z","repository":{"id":45809562,"uuid":"356771442","full_name":"RobLoach/raylib-aseprite","owner":"RobLoach","description":"Load Aseprite files for animated sprites in raylib.","archived":false,"fork":false,"pushed_at":"2024-11-20T17:20:17.000Z","size":241,"stargazers_count":93,"open_issues_count":8,"forks_count":10,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-30T18:02:08.552Z","etag":null,"topics":["aseprite","raylib"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RobLoach.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-11T05:04:21.000Z","updated_at":"2025-03-11T17:14:21.000Z","dependencies_parsed_at":"2024-05-30T20:18:50.195Z","dependency_job_id":"3066edf8-dcab-4762-b006-0a7eab50a9cc","html_url":"https://github.com/RobLoach/raylib-aseprite","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Fraylib-aseprite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Fraylib-aseprite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Fraylib-aseprite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobLoach%2Fraylib-aseprite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RobLoach","download_url":"https://codeload.github.com/RobLoach/raylib-aseprite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247994121,"owners_count":21030050,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aseprite","raylib"],"created_at":"2024-10-10T07:19:46.607Z","updated_at":"2025-04-09T07:07:35.756Z","avatar_url":"https://github.com/RobLoach.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# raylib-aseprite\n\nLoad [Aseprite](https://www.aseprite.org) `.aseprite` and `.ase` files for animated sprites in [raylib](https://www.raylib.com).\n\n![examples/raylib-aseprite-aseprite.png](examples/raylib-aseprite-aseprite.png)\n![examples/raylib-aseprite-example.gif](examples/raylib-aseprite-example.gif)\n\n## Features\n\n- Load [Aseprite](https://www.aseprite.org/) files directly for use in raylib\n- Draw individual frames\n- Load and draw [Aseprite tags](https://www.aseprite.org/docs/tags/) as sprite animations\n- Support for Forwards, Backwards, and Ping-Pong animations\n- Adjust tag animation speed by using `tag.speed`\n- Pause tag animations by using `tag.pause`\n- Toggle whether animations will continue when they finish with `tag.loop`\n- Load [Aseprite slice](https://www.aseprite.org/docs/slices/) rectangles for collisions and bounds\n\n## Usage\n\nThis is a header-only library. To use it, define `RAYLIB_ASEPRITE_IMPLEMENTATION` in one .c source file before including [*raylib-aseprite.h*](include). You will also have to link the raylib dependency.\n\n### Example\n\nThe below is a basic example, see the [examples](examples) folder for more.\n\n``` c\n#include \"raylib.h\"\n\n#define RAYLIB_ASEPRITE_IMPLEMENTATION\n#include \"raylib-aseprite.h\"\n\nint main() {\n    InitWindow(640, 480, \"Aseprite Example\");\n\n    // Load the George Aseprite file.\n    Aseprite george = LoadAseprite(\"resources/george.aseprite\");\n\n    // Load the Walk Down tag.\n    AsepriteTag walkdown = LoadAsepriteTag(george, \"Walk-Down\");\n    walkdown.speed = 2; // Double the animation speed.\n\n    while(!WindowShouldClose()) {\n        // Update the animation frame.\n        UpdateAsperiteTag(\u0026walkdown);\n\n        BeginDrawing();\n        {\n            ClearBackground(RAYWHITE);\n\n            // Draw the first frame from the George sprite.\n            DrawAseprite(george, 0, 100, 100, WHITE);\n\n            // Draw the Walk Down animation.\n            DrawAsepriteTag(walkdown, 200, 100, WHITE);\n        }\n        EndDrawing();\n    }\n\n    // Clean up the George aseprite.\n    UnloadAseprite(george);\n\n    CloseWindow();\n    return 0;\n}\n```\n\nSee the [examples directory](examples) for more demonstrations of how to use *raylib-aseprite*.\n\n### API\n\n``` c\n// Aseprite functions\nAseprite LoadAseprite(const char* fileName);                        // Load an .aseprite file\nAseprite LoadAsepriteFromMemory(unsigned char* fileData, int size);  // Load an aseprite file from memory\nbool IsAsepriteValid(Aseprite aseprite);                            // Check if the given Aseprite was loaded successfully\nvoid UnloadAseprite(Aseprite aseprite);                             // Unloads the aseprite file\nvoid TraceAseprite(Aseprite aseprite);                              // Display all information associated with the aseprite\nTexture GetAsepriteTexture(Aseprite aseprite);                      // Retrieve the raylib texture associated with the aseprite\nint GetAsepriteWidth(Aseprite aseprite);                            // Get the width of the sprite\nint GetAsepriteHeight(Aseprite aseprite);                           // Get the height of the sprite\nvoid DrawAseprite(Aseprite aseprite, int frame, int posX, int posY, Color tint);\nvoid DrawAsepriteV(Aseprite aseprite, int frame, Vector2 position, Color tint);\nvoid DrawAsepriteEx(Aseprite aseprite, int frame, Vector2 position, float rotation, float scale, Color tint);\nvoid DrawAsepritePro(Aseprite aseprite, int frame, Rectangle dest, Vector2 origin, float rotation, Color tint);\n\n// Aseprite Tag functions\nAsepriteTag LoadAsepriteTag(Aseprite aseprite, const char* name);   // Load an Aseprite tag animation sequence\nAsepriteTag LoadAsepriteTagFromIndex(Aseprite aseprite, int index); // Load an Aseprite tag animation sequence from its index\nint GetAsepriteTagCount(Aseprite aseprite);                         // Get the total amount of available tags\nbool IsAsepriteTagValid(AsepriteTag tag);                           // Check if the given Aseprite tag was loaded successfully\nvoid UpdateAsepriteTag(AsepriteTag* tag);                           // Update the tag animation frame\nAsepriteTag GenAsepriteTagDefault();                                // Generate an empty Tag with sane defaults\nvoid DrawAsepriteTag(AsepriteTag tag, int posX, int posY, Color tint);\nvoid DrawAsepriteTagV(AsepriteTag tag, Vector2 position, Color tint);\nvoid DrawAsepriteTagEx(AsepriteTag tag, Vector2 position, float rotation, float scale, Color tint);\nvoid DrawAsepriteTagPro(AsepriteTag tag, Rectangle dest, Vector2 origin, float rotation, Color tint);\n\n// Aseprite Slice functions\nAsepriteSlice LoadAsepriteSlice(Aseprite aseprite, const char* name);   // Load a slice from an Aseprite based on its name.\nAsepriteSlice LoadAsperiteSliceFromIndex(Aseprite aseprite, int index); // Load a slice from an Aseprite based on its index.\nint GetAsepriteSliceCount(Aseprite aseprite);                       // Get the amount of slices that are defined in the Aseprite.\nbool IsAsepriteSliceValid(AsepriteSlice slice);                     // Return whether or not the given slice was found.\nAsepriteSlice GenAsepriteSliceDefault();                            // Generate empty Aseprite slice data.\n```\n\n## Development\n\nTo build the example locally, and run tests, use [cmake](https://cmake.org/).\n\n``` bash\ngit submodule update --init\nmkdir build\ncd build\ncmake ..\nmake\ncd examples\n./raylib-aseprite-example\n```\n\nThis uses [cute_aseprite.h](https://github.com/RandyGaul/cute_headers/blob/master/cute_aseprite.h) to handle loading the aseprite file. Thank you to [Randy Gaul's cute_headers](https://github.com/RandyGaul/cute_headers) for making this all possible.\n\n## License\n\n*raylib-aseprite* is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check [LICENSE](LICENSE) for further details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobloach%2Fraylib-aseprite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobloach%2Fraylib-aseprite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobloach%2Fraylib-aseprite/lists"}