{"id":19489640,"url":"https://github.com/chadowo/aniruby","last_synced_at":"2025-10-17T22:08:00.578Z","repository":{"id":189413630,"uuid":"680633582","full_name":"Chadowo/aniruby","owner":"Chadowo","description":"Create sprite animations on Gosu, simply and easily","archived":false,"fork":false,"pushed_at":"2024-07-25T13:25:56.000Z","size":213,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-30T13:52:58.711Z","etag":null,"topics":["game-development","gamedev","gamedev-library","gosu","libgosu","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/Chadowo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-08-19T22:02:21.000Z","updated_at":"2024-07-25T13:25:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"e7bff06c-a7c8-449d-9ddd-94559209051e","html_url":"https://github.com/Chadowo/aniruby","commit_stats":null,"previous_names":["chadowo/aniruby"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chadowo%2Faniruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chadowo%2Faniruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chadowo%2Faniruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Chadowo%2Faniruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Chadowo","download_url":"https://codeload.github.com/Chadowo/aniruby/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224014291,"owners_count":17241281,"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":["game-development","gamedev","gamedev-library","gosu","libgosu","ruby"],"created_at":"2024-11-10T21:09:26.277Z","updated_at":"2025-10-17T22:07:55.529Z","avatar_url":"https://github.com/Chadowo.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AniRuby\n\n![Gem (including prereleases)](https://img.shields.io/gem/v/aniruby?style=flat-square\u0026logo=rubygems\u0026logoColor=white\u0026color=blue) ![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/chadowo/aniruby/minitest.yml?style=flat-square\u0026logo=github\u0026label=minitest\u0026link=https%3A%2F%2Fgithub.com%2FChadowo%2Faniruby%2Factions%2Fworkflows%2Fminitest.yml) ![GitHub](https://img.shields.io/github/license/chadowo/aniruby?style=flat-square)\n\nCreate sprite animations on [Gosu](https://www.libgosu.org/), simply and easily.\n\n## Summary\n\nThis gem will provide you with a nice n easy interface to do sprite animations\non Gosu, while being as nifty and simple as possible.\n\nThe gem is made in pure Ruby with no dependencies at all (except Gosu, of course) so\nit's quite lightweight.\n\n## Install\n\nYou can install the gem with the following command:\n\n```console\ngem install aniruby\n```\n\nor use it with a bundle:\n\n```ruby\ngem 'aniruby'\n```\n\n## Getting Started\n\nThe smallest example:\n\n```ruby\nrequire 'gosu'\nrequire 'aniruby'\n\nclass MyWindow \u003c Gosu::Window\n  def initialize\n    super(800, 600, false)\n\n    @animation = AniRuby::Animation.new('my_spritesheet.png', 32, 32,\n                                        0.15, retro: false, loop: true)\n  end\n\n  def update\n    # Remember to update your animation!\n    @animation.update\n  end\n\n  def draw\n    @animation.draw(0, 0)\n  end\nend\n```\n\n### Explanation\n\nWhen you create a animation, you'll need to have an *spritesheet*, where you have\neach sprite of the animation, that's the first argument to `Animation#new`, then\nyou'll need the dimensions of each individual sprite on your spritesheet, in the\nexample provided we assume each sprite in the spritesheet is 32x32. Take for example\nthe following spritesheet courtesy of penzilla on [Itch.io](https://penzilla.itch.io/hooded-protagonist)\n\n![example spritesheet](assets/example_spritesheet.png)\n\nwhen we load it, it'll be divided into different image based on the individual\ndimensions of each sprite, so if we specify 32 as width and 32 as height then the\nspritesheet will be divided like this:\n\n![example spritesheet quads](assets/example_spritesheet_quads.png)\n\nThat's the bare minimum to get an animation, of course you can enable Gosu's retro\noption so pixel animations will still look crisp when scaled, enable looping or specify\nthe duration of the animation (or for every frame even!).\n\nIn the example above we initialize the animation with retro off, looping on and\nwith a duration of 0.15 (150ms) for every frame. So we'll get something like this:\n\n![example spritesheet result](assets/example_spritesheet_result.gif)\n\nAin't that nice?\n\n### Drawing\n\nYou can draw an animation like any other `Gosu::Image`! An animation has both\n`Animation#draw` and `Animation#draw_rot`, these methods mimic the ones on Gosu, so you don't\nhave to learn anything new.\n\n### Extras\n\nEach `Animation` has extra helpful methods, like `pause` \u0026 `unpause`, `reset`,\n`done?`, etc. I recommend you to look on the source, its pretty small and easy to\nunderstand, or build the YARD documentation with:\n\n```console\nrake doc\n```\n\n## Development\n\n### Setup\n\nFirst clone this repo locally:\n\n```console\ngit clone https://github.com/Chadowo/aniruby\n```\n\nNext you'll need to install the development dependencies of this gem with\n`bundle install`, Then you can use `rake` to build or test the gem.\n\n### Testing\n\n[Minitest](https://github.com/minitest/minitest) is used to unit test this gem.\nTo run the tests just call `rake`.\n\n## Roadmap\n\n- more fine-grained control of animation\n- being able to make an animation stitching `Gosu::Image`'s together\n- mirroring\n- inverse animation\n- multiple animation from a single spritesheet\n\n## License\n\nThis gem is licensed under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchadowo%2Faniruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchadowo%2Faniruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchadowo%2Faniruby/lists"}