{"id":13524232,"url":"https://github.com/besnoi/animX","last_synced_at":"2025-04-01T02:31:01.986Z","repository":{"id":134907534,"uuid":"222457916","full_name":"besnoi/animX","owner":"besnoi","description":"An animation library for Love2D with unique features","archived":false,"fork":false,"pushed_at":"2021-10-16T14:57:49.000Z","size":2099,"stargazers_count":23,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-21T13:00:37.118Z","etag":null,"topics":["animation-fsm","animation-library","animation-modes","extracting-animations","love2d","love2d-animation-library","love2d-library","spritesheet-animation"],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/besnoi.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-11-18T13:39:30.000Z","updated_at":"2024-03-13T20:07:47.000Z","dependencies_parsed_at":"2023-05-23T22:30:19.291Z","dependency_job_id":null,"html_url":"https://github.com/besnoi/animX","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/besnoi%2FanimX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/besnoi%2FanimX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/besnoi%2FanimX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/besnoi%2FanimX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/besnoi","download_url":"https://codeload.github.com/besnoi/animX/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222693039,"owners_count":17024034,"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":["animation-fsm","animation-library","animation-modes","extracting-animations","love2d","love2d-animation-library","love2d-library","spritesheet-animation"],"created_at":"2024-08-01T06:01:08.219Z","updated_at":"2024-11-02T08:31:34.829Z","avatar_url":"https://github.com/besnoi.png","language":"Lua","funding_links":[],"categories":["Animation"],"sub_categories":[],"readme":"# animX\n\n*Animation in Love2d has never been so easy!!* Now I hate to look like a soap salesman... but animX has [all the features](#features-of-animx) you'd expect from an animation library plus some extra features of its own! I suggest you head over to [A quick walkthrough](#a-quick-walkthrough) if you are short on time!\n\n## What animX is about?\n\nanimX is all about handling animations in a manner that makes your code much more declarative, much more readable, and much more shorter.\n\n## Features of animX:\n-------------------------\n\n- Has special Animation instances with animation modes like `loop`, `bounce`, `rewind`, etc!\n- Supports different delays for individual frames just like Bart's library but without consuming too much memory\n- Allows loading animations and animation instances from a metafile\n- Has special Animated Sprites aka *Actors* to handle animations (execution, transitions, etc) by their name\n- Allows loading group of animations and all animations for an *actor* from a metafile\n- Supports callback functions like `onSwitch`, `onFrameChange`,`onAnimOver`,`onCycleOver`,etc just like [Walt](https://github.com/davisdude/Walt)\n- Allows creating animation from single as well as multiple images (for *Actors* I mean)\n- Has a very comfortable animation extraction system supporting numerous algorithms **\\***\n- After extracting animations you can export them to XML (again as a single entity or as group of animations)\n- Also supports animation's source styles like `rough`, `smooth` (just like Katsudo)\n- Has a number of aliases to make you feel it's *your* library and *you* wrote it!\n\n\u003e **\\*** In case you don't have metafiles to work with!\n\n------------------------------------------\n**Note:** For metafile, only XML data-format is supported (as of now). But I'll be happy to write for JSON (and other formats) if some-one really wants me to!\n\n\n## A Quick Walkthrough\n\nWorking with symmetric spritesheets is a *hell* lot easier with animX. Let's say we have this spritesheet:-\n\u003cp align='center'\u003e\n\u003cimg src='Examples/Exporting%20Animation/glitch_crab.png' title=\"The SpriteSheet for crab animation (Credit- Glitch)\"\u003e\u003cbr/\u003e\n\u003c/p\u003e\n\nThere are 6 sprites per row and a total of 24 images!! So you do just this:-\n\n```lua\nanim=animx.newAnimation{\n\timg='glitch_crab.png',   --url/reference to the image\n\tspritesPerRow=6,\n\tnoOfFrames=24\n}:loop()\n```\nAnd that's it! You loaded 24 quads in just four lines! (The last line only loops the animation which ofcourse is not necessary!)\n\n\u003e But what about huge non-symmetric spritesheets?\n\nLet's say we have this spritesheet by Kenney and we want to animate this in Love2D (Note this spritesheet is unsymmetric with alternating width and height for each frame)\n\n\u003cp align='center'\u003e\n\u003cimg src='Examples/Importing%20Animation%20from%20XML%20to%20Actor/kenney_asset.png' title=\"The SpriteSheet for walking animation (Credit- Kenney)\"\u003e\u003cbr/\u003e\n\u003c/p\u003e\n\nNo probs. As long as you have an generic [XML metafile](Examples/Importing%20Animation%20from%20XML%20to%20Actor/walk_sheet.xml) describing the animation - this is a walk in the park - atleast with animX by your side:-\n\n```lua\nanimx=require 'animx'\n\nalien=animx.newAnimation('res/spritesheet.png')\n--Note res/spritesheet.xml must be present!!\n\nfunction love.draw()\n\talien:draw()\nend\n```\n\nBut that was only for walking. What about jumping, swimming and all of these? Should one rely on multiple XML files for that? **No** To solve this problem animX has special *actors* which are nothing but animation holders and make switching between animations a lot easier\n\nSo to increase the bar let's say we have this image here with this difficult to parse [XML file](Examples/Side%20Scroller/res/spritesheet.xml) by the same name:\n\n\u003cp align='center'\u003e\n\u003cimg width=664 height=481 src='Examples/Side%20Scroller/res/spritesheet.png' title=\"The SpriteSheet for our actor. Sorry about bad packing at some places! (Credit- Segel)\"\u003e\u003cbr/\u003e\n\u003c/p\u003e\n\nSince this image is symmetric we don't even need the metafile as demonstrated in [this example](Examples/Side%20Scroller/main2.lua) but since it's a good idea to keep data away from code here's how we do it with animX:-\n\n```lua\nanimx=require 'animx'\n\nsamurai=animx.newActor('res/spritesheet.png'):switch('walking')\n\nfunction love.draw()\n\t--This will display our Samurai running at the center of the screen\n\tsamurai:draw(400,300,0,1,1,samurai:getWidth()/2,samurai:getHeight()/2)\nend\n```\n\nNote that we are not doing ```animx.update(dt)``` in ``love.update`` only because there's nothing else in ``love.update`` and animX overrides it by default making work a little easier for us in such cases (where all that `love.update` contains is `animx.update`)\n\nThere are also other stuff such texture styles, animation modes, animation handlers, etc which we didn't talk here. But I've dedicated a short tutorial for that over [here](Examples)\n\n\n### Installing animX\n\nJust drop the package (by the name `animx`) in a seperate folder and require it:-\n\n```lua\nanimx=require 'animx\n```\n\n### Running Demos\n\nanimX comes with a lot of demos to get you started. These are available in the [demos](TODO) branch. You can run them with the latest (as of now) version of Love2D (11.3)\n\n### Documentation\n\nYou can read the documentation over [here](https://github.com/YoungNeer/animX/wiki)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbesnoi%2FanimX","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbesnoi%2FanimX","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbesnoi%2FanimX/lists"}