{"id":15722502,"url":"https://github.com/insality/panthera","last_synced_at":"2025-05-09T00:05:54.826Z","repository":{"id":236492317,"uuid":"792682308","full_name":"Insality/panthera","owner":"Insality","description":"Panthera Animation Runtime for Defold Game Engine","archived":false,"fork":false,"pushed_at":"2025-04-04T17:48:48.000Z","size":20972,"stargazers_count":74,"open_issues_count":7,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-09T00:05:43.613Z","etag":null,"topics":["animation","defold","defold-extension","defold-library","defold-module","editor","runtime","software"],"latest_commit_sha":null,"homepage":"https://insality.github.io/panthera/example/","language":"Lua","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/Insality.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"insality","ko_fi":"insality","buy_me_a_coffee":"insality"}},"created_at":"2024-04-27T09:09:34.000Z","updated_at":"2025-05-06T11:29:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"53de93ab-75c2-434f-991c-14accc7aceb0","html_url":"https://github.com/Insality/panthera","commit_stats":{"total_commits":47,"total_committers":2,"mean_commits":23.5,"dds":0.08510638297872342,"last_synced_commit":"11fbfab1ec0bc4c026b6596d253091172f112181"},"previous_names":["insality/panthera"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Insality%2Fpanthera","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Insality%2Fpanthera/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Insality%2Fpanthera/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Insality%2Fpanthera/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Insality","download_url":"https://codeload.github.com/Insality/panthera/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253166518,"owners_count":21864476,"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","defold","defold-extension","defold-library","defold-module","editor","runtime","software"],"created_at":"2024-10-03T22:08:09.726Z","updated_at":"2025-05-09T00:05:54.803Z","avatar_url":"https://github.com/Insality.png","language":"Lua","funding_links":["https://github.com/sponsors/insality","https://ko-fi.com/insality","https://buymeacoffee.com/insality","https://www.buymeacoffee.com/insality"],"categories":[],"sub_categories":[],"readme":"![](media/runtime_logo.png)\n\n[![Github-sponsors](https://img.shields.io/badge/sponsor-30363D?style=for-the-badge\u0026logo=GitHub-Sponsors\u0026logoColor=#EA4AAA)](https://github.com/sponsors/insality) [![Ko-Fi](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge\u0026logo=ko-fi\u0026logoColor=white)](https://ko-fi.com/insality) [![BuyMeACoffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=for-the-badge\u0026logo=buy-me-a-coffee\u0026logoColor=black)](https://www.buymeacoffee.com/insality)\n\n[![](https://img.shields.io/badge/Release-download-blue?style=for-the-badge)](https://github.com/Insality/panthera/tags)\n\n# Panthera Runtime\n\n**Panthera Runtime** - a [Defold](https://defold.com/) library designed to integrate animations created with [**Panthera 2.0 Editor**](/docs_editor/README.md), a versatile animation software, into Defold projects. This runtime library simplifies the process of importing and playing back Panthera animations, enhancing the visual quality and interactivity of Defold games and applications.\n\n## Features\n\n- **Seamless Animation Integration**: Import and use Panthera 2.0 animations directly in Defold.\n- **Full Animation Support**: Supports all animation features provided by Panthera 2.0, including events, animation blending, nested animations and more.\n- **Flexible Usage**: Compatible with both Game Objects and GUI nodes in Defold, allowing for versatile application across different game elements.\n- **Animation Cursor**: Provides a way to control animation manually, allowing for precise control over playback and synchronization with game events.\n- **Hot Reloading**: Reload animations on the fly during development, enabling rapid iteration and testing of animation assets.\n\n## Panthera 2.0 Editor\n\nRead the [**Panthera 2.0 Editor**](/docs_editor/README.md) guide to learn about the Panthera 2.0 Editor, an innovative tool developed using the Defold engine, designed to simplify and enhance the creation of animations for Defold projects.\n\n## Setup\n\n### [Dependency](https://defold.com/manuals/libraries/#setting-up-library-dependencies)\n\nOpen your `game.project` file and add the following lines to the dependencies field under the project section:\n\n\n**[Defold Tweener](https://github.com/Insality/defold-tweener)**\n\n```\nhttps://github.com/Insality/defold-tweener/archive/refs/tags/3.zip\n```\n\n**[Panthera Runtime](https://github.com/Insality/panthera)**\n\n```\nhttps://github.com/Insality/panthera/archive/refs/tags/runtime.4.zip\n```\n\nAfter that, select `Project ▸ Fetch Libraries` to update [library dependencies]((https://defold.com/manuals/libraries/#setting-up-library-dependencies)). This happens automatically whenever you open a project so you will only need to do this if the dependencies change without re-opening the project.\n\n### Library Size\n\n\u003e **Note:** The library size is calculated based on the build report per platform\n\n| Platform         | Library Size |\n| ---------------- | ------------ |\n| HTML5            | **12.42 KB** |\n| Desktop / Mobile | **21.35 KB** |\n\n\n### Hot Reloading Animations for Development [Optional]\n\n\u003e **Note:** Hot reloading is designed for use in development environments only. Hot reloading only works for animations from JSON files. If you using a lua table for animations, hot reloading will not work.\n\nPanthera Runtime supports hot reloading of animations for a more efficient development workflow. This feature allows animations to be reloaded automatically without restarting your Defold game, facilitating rapid iteration on animation assets.\n\nTo enable hot reloading of animations, include the following settings in your `game.project` file:\n\n```ini\n[panthera]\nhotreload_animations = 1\n```\n\n**Configuration Details:**\n\n- **hotreload_animations**: Set to `1` to enable hot reloading. This feature is active only in debug mode.\n\n**Implementing Hot Reload in Defold:**\n\nTo utilize hot reloading, set up a window event listener in your Defold script that triggers `panthera.reload_animation()` when the game window gains focus. This ensures that animations are refreshed automatically during development:\n\n```lua\nlocal panthera = require(\"panthera.panthera\")\n\n-- Reload animation when window is focused, only for debug and on desktop\nwindow.set_listener(function(_, event)\n    if event == window.WINDOW_EVENT_FOCUS_GAINED then\n        panthera.reload_animation()\n    end\nend)\n```\n\n## API Reference\n\n### Quick API Reference\n\n```lua\npanthera.create_gui(animation_path_or_data, [template], [nodes])\npanthera.create_go(animation_path_or_data, [collection_name], [objects])\npanthera.create(animation_path_or_data, adapter, get_node)\npanthera.clone_state(animation_state)\npanthera.play(animation_state, animation_id, [options])\npanthera.stop(animation_state)\npanthera.set_time(animation_state, animation_id, time)\npanthera.get_time(animation_state)\npanthera.get_duration(animation_state, animation_id)\npanthera.is_playing(animation_state)\npanthera.get_latest_animation_id(animation_state)\npanthera.set_logger([logger_instance])\npanthera.reload_animation([animation_path])\n```\n\n\n### API Reference\n\nRead the [API Reference](API_REFERENCE.md) file to see the full API documentation for the module.\n\n\n### Usage Examples\n\nIntegrate Panthera animations into Defold with these concise examples:\n\n#### Example 1: Start animation in GO\n\nLoad and play a animation file using the GO adapter.\n\n```lua\nlocal panthera = require(\"panthera.panthera\")\nlocal animation = require(\"path.to.panthera_animation\")\n\nfunction init(self)\n    self.animation = panthera.create_go(animation)\n    panthera.play(self.animation, \"run\", { is_loop = true })\nend\n```\nThis example applies a looping run animation to a game object when the game starts.\n\n#### Example 2: Start animation in GUI\n\nLoad and play a animation file using the GUI adapter.\n\n```lua\nlocal panthera = require(\"panthera.panthera\")\nlocal animation = require(\"path.to.panthera_animation\")\n\nfunction init(self)\n    self.animation = panthera.create_gui(animation)\n    panthera.play(self.animation, \"fade_in\")\nend\n```\nThis example applies a fade-in animation to a GUI node when the game starts\n\n\n#### Example 3: Check if animation is playing\n\nCheck if an animation is currently playing and retrieve the current animation ID.\n\n```lua\nlocal panthera = require(\"panthera.panthera\")\n\nfunction init(self)\n    -- You can use JSON instead of Lua tables, but it should be accessible with sys.load_resource()\n    self.animation = panthera.create_gui(\"/animations/animation.json\")\n    local is_playing = panthera.is_playing(self.animation)\n    local animation_id = panthera.get_latest_animation_id(self.animation)\n\n    if is_playing then\n        print(\"The animation is currently playing: \", animation_id)\n    else\n        print(\"The animation is not playing\")\n    end\nend\n```\n\n### GO Animation Restrictions\n\nWhen integrating Panthera 2.0 animations with Defold game objects (GOs), it's essential to know which properties you can animate:\n\nBy default, sprite components uses the `tint` property and label components use the `color` property. Panthera try to use `color` property. To enable `color` property you should set the material of sprite component to `/panthera/materials/sprite.material` or use any other material with `color` attribute.\n\n- **Position**: Move objects.\n- **Rotation**: Rotate objects.\n- **Scale**: Scale objects.\n- **Color**: Update color of sprite or Text component.\n- **Slice9**: Update slice9 properties of sprite component.\n- **Size**: Update size of sprite component.\n- **Text**: Update text content of label component.\n- **Texture**: Switch textures of sprite component.\n- **Enabled**: Toggle object enabled/disabled.\n\n\n### Animation Blending\n\nRead the [Animation Blending](docs/animation_blending.md) guide to learn how to blend multiple animations simultaneously on the same entity, creating complex, layered animations that enhance the visual fidelity and dynamism of your game.\n\n\n### Customizing Your Adapter\n\nWhile **Panthera** Runtime provides a default adapter for game objects and GUI, you might need to customize your adapter based on your project's needs. Read the [Customizing Your Adapter](docs/panthera_adapter.md) guide to learn how to map easing types, handle custom events, and use your custom adapter with Panthera Runtime.\n\n\n## License\n\nPanthera Runtime is licensed under the MIT License - see the [LICENSE](/LICENSE) file for details.\n\n\n## Issues and Suggestions\n\nFor any issues, questions, or suggestions, please [create an issue](https://github.com/Insality/panthera/issues).\n\n\n## Changelog\n\nRead the [CHANGELOG](/CHANGELOG.md) to learn about the latest updates and features in Panthera Runtime.\n\n\n## 👏 Contributors\n\n\u003ca href=\"https://github.com/Insality/panthera/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contributors-img.web.app/image?repo=insality/panthera\"/\u003e\n\u003c/a\u003e\n\n\n## ❤️ Support the Project ❤️\n\nYour support motivates me to keep creating and maintaining projects for **Defold**. Consider supporting if you find my projects helpful and valuable.\n\n[![Github-sponsors](https://img.shields.io/badge/sponsor-30363D?style=for-the-badge\u0026logo=GitHub-Sponsors\u0026logoColor=#EA4AAA)](https://github.com/sponsors/insality) [![Ko-Fi](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge\u0026logo=ko-fi\u0026logoColor=white)](https://ko-fi.com/insality) [![BuyMeACoffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=for-the-badge\u0026logo=buy-me-a-coffee\u0026logoColor=black)](https://www.buymeacoffee.com/insality)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsality%2Fpanthera","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finsality%2Fpanthera","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finsality%2Fpanthera/lists"}