{"id":15097564,"url":"https://github.com/kangaroux/go-spritesheet","last_synced_at":"2025-04-14T23:08:49.260Z","repository":{"id":57597735,"uuid":"378330876","full_name":"Kangaroux/go-spritesheet","owner":"Kangaroux","description":"Use YAML to make working with sprite sheets easy. Compatible with ebiten","archived":false,"fork":false,"pushed_at":"2021-06-20T13:54:05.000Z","size":10,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-14T23:08:38.345Z","etag":null,"topics":["ebiten","game","game-development","golang","sprites","spritesheet","yaml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kangaroux.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}},"created_at":"2021-06-19T05:24:59.000Z","updated_at":"2023-11-17T14:24:49.000Z","dependencies_parsed_at":"2022-08-28T10:21:53.037Z","dependency_job_id":null,"html_url":"https://github.com/Kangaroux/go-spritesheet","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kangaroux%2Fgo-spritesheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kangaroux%2Fgo-spritesheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kangaroux%2Fgo-spritesheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kangaroux%2Fgo-spritesheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kangaroux","download_url":"https://codeload.github.com/Kangaroux/go-spritesheet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975316,"owners_count":21192209,"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":["ebiten","game","game-development","golang","sprites","spritesheet","yaml"],"created_at":"2024-09-25T16:23:37.612Z","updated_at":"2025-04-14T23:08:49.241Z","avatar_url":"https://github.com/Kangaroux.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-spritesheet\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/kangaroux/go-spritesheet.svg)](https://pkg.go.dev/github.com/kangaroux/go-spritesheet)\n\nUse YAML to describe your sprite sheet and give your sprites names. `go-spritesheet` will take care of the math for each sprite location, as well as provide a map for easy sprite lookups.\n\n## Using With Ebiten\n\n`go-spritesheet` pairs nicely with a library like [ebiten](https://github.com/hajimehoshi/ebiten).\n\n```go\n// Load the config\nsheet, err := spritesheet.OpenAndRead(\"spritesheet.yml\")\n\nif err != nil {\n    panic(err)\n}\n\n// Load the image\nimg, _, err := ebitenutil.NewImageFromFile(sheet.Image)\n\nif err != nil {\n    panic(err)\n}\n\nsprites := sheet.Sprites()\n\n// Get the sprite\ns := img.SubImage(sprites[\"mySprite\"].Rect())\n```\n\n## YAML Example\n\n```yaml\nimage: hero.png\n\nrows: 3\ncols: 4\nsize: 16\n\nsprites: [\n    idle_1, idle_2, idle_3, idle_4,\n    run_1, run_2, run_3, run_4,\n    atk_1, atk_2, atk_3, atk_4\n]\n```\n\n## Config Format\n\n- `image`: The path to your sprite sheet image.\n- `rows`: The number of rows in the sprite sheet.\n- `cols`: The number of columns in the sprite sheet.\n- `size`: The size of each sprite, in pixels.\n- `sprites`: A list of sprite names.\n    - Names must be unique.\n    - Must contain `0` to `n` entries, where `n` is `rows*cols`\n    - Using an underscore `_` skips the sprite. Useful if you have \"holes\" in your sprite sheet.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkangaroux%2Fgo-spritesheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkangaroux%2Fgo-spritesheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkangaroux%2Fgo-spritesheet/lists"}