{"id":13995205,"url":"https://github.com/maxgribov/Spine","last_synced_at":"2025-07-22T21:32:20.062Z","repository":{"id":56947145,"uuid":"120352296","full_name":"maxgribov/Spine","owner":"maxgribov","description":"Unofficial Spine runtime Swift library, allows you to play animations created in the Spine app (http://esotericsoftware.com).","archived":false,"fork":false,"pushed_at":"2024-09-28T22:46:34.000Z","size":1946,"stargazers_count":188,"open_issues_count":2,"forks_count":36,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-30T11:43:28.507Z","etag":null,"topics":["ios","macos","spine","spritekit","swift","tvos","watchos"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/maxgribov.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}},"created_at":"2018-02-05T19:37:37.000Z","updated_at":"2024-10-21T16:53:19.000Z","dependencies_parsed_at":"2023-12-26T16:32:23.978Z","dependency_job_id":"b6060eaa-18a1-4e40-a397-76d3b54e5929","html_url":"https://github.com/maxgribov/Spine","commit_stats":{"total_commits":141,"total_committers":4,"mean_commits":35.25,"dds":"0.028368794326241176","last_synced_commit":"080c0ceade3cbccdc73fef6a8305632da5ecab5b"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxgribov%2FSpine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxgribov%2FSpine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxgribov%2FSpine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxgribov%2FSpine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxgribov","download_url":"https://codeload.github.com/maxgribov/Spine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227177807,"owners_count":17743170,"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":["ios","macos","spine","spritekit","swift","tvos","watchos"],"created_at":"2024-08-09T14:03:18.186Z","updated_at":"2024-11-29T17:31:11.592Z","avatar_url":"https://github.com/maxgribov.png","language":"Swift","readme":"![Tests workflow](https://github.com/maxgribov/Spine/actions/workflows/swift.yml/badge.svg)\n# Spine\nThis Swift library allows you to upload characters and their animations from the [Spine (ESS version)](http://esotericsoftware.com) (v4.1+) to `SpriteKit` for platforms::\n\n`iOS` `macOS` `tvOS` `watchOS`\n\nImplemented almost all the functionality of the essential version of Spine app:\nAnimation of bones, skins, animation of slots, creation of physical bodies on the basis of bounding boxes and some other. See [Implemented Features](#implemented-features) for more information.\n\n\u003eWarning: There is no implementation of Spine Pro functionality and it is not planned. There are no such features as meshes and their animations. Moreover, when trying to load a character from Spine Pro version with meshes, it will not even be displayed correctly on the screen, a lot of textures will be missing.\u003cbr /\u003e\u003cbr /\u003e If you really need Spine's Pro functionality, and you don't care about SpriteKie, take a look at the official Spine iOS runtime: https://esotericsoftware.com/spine-ios\n\nExample of working with the library: [Sample project](https://github.com/maxgribov/SpineSampleProject)\u003cBR\u003e\nLearn more about working with the library: [Spine Wiki](https://github.com/maxgribov/Spine/wiki)\nYou can also compile the documentation in Xcode\n\n![Hero](images/spine_readme_hero.png)\n\n## Installing\nSpine Library can be installed using Swift Package Manager.\n\nUse the package URL to search for the URLImage package: [https://github.com/maxgribov/Spine](https://github.com/maxgribov/Spine)\n\nFor how-to integrate package dependencies refer to [Adding Package Dependencies to Your App documentation.](https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app)\n\n## Basic Usage\n\n### Assets\n\n#### Files\n\n1. In `Assets` catalog create `folder`. *(`Goblins` folder in example below)*\n2. Create `sprite atlases`. *(`default`, `goblin` and `goblingirl` sprite atlases in example below)*\n3. Put images into sprite atlaces. \n\u003eNote: Note that the images that are in the `root` folder of the Spine app project must be in the sprite atlas named `default` in the Xcode project.\n\nFinal result should looks something like this:\n\n![Assets](images/spine_readme_assets.png)\n\n#### Namespace\n\nSet `Provides Namespace` option enabled for the root folder and for all sprite atlases in the Xcode's attribute inspector:\n\n![Namespace](images/spine_readme_assets_namespace.png)\n\n\u003eWarning: If you forget to set the namespace, later when you initialize your character images can be just not found.\n\n#### JSON\n\nPut the JSON exported from the Spine application somewhere in your project:\n\n![json](images/spine_readme_assets_json.png)\n\nFor more information about assets see [Assets Wiki](https://github.com/maxgribov/Spine/wiki/Assets)\n\n### Code\n\nSomewhere at the beginning of your code, import the `Spine` library:\n\n```swift\nimport Spine\n```\n\nThe easiest way to load a character from a `JSON` file and apply skin to it is to use the appropriate `Skeleton` class init:\n\n```swift\nlet character = try Skeleton(json: \"goblins-ess\", folder: \"goblins\", skin: \"goblin\")\n```\n\u003e[Skeleton](Spine/Skeleton.swift) is a subclass of `SKNode`, so you can do with it whatever you can do with `SKNode` itself\n\nThis way you can apply the animation created in Spine to the character:\n\n```swift\nlet walkAnimation = try character.action(animation: \"walk\")\ncharacter.run(walkAnimation)\n```\n\u003eThe `action(animation:)` method returns an object of the `SKAction` class so that you can use this animation as any other object of the `SKAction` class\n\nThis is an example of the simplest scene in which we load our Goblin character, add it to the scene and start walk animation in an endless loop:\n```swift\nimport SpriteKit\nimport Spine\n\nclass GameScene: SKScene {\n    \n    override func didMove(to view: SKView) {\n        \n        do {\n            \n            let character = try Skeleton(json: \"goblins-ess\", folder: \"goblins\", skin: \"goblin\")\n            character.name = \"character\"\n            character.position = CGPoint(x: self.size.width / 2, y: (self.size.height / 2) - 200)\n            addChild(character)\n            \n            let walkAnimation = try character.action(animation: \"walk\")\n            character.run(.repeatForever(walkAnimation))\n\n        } catch {\n            \n            print(error)\n        }\n    }\n}\n```\n\n## Implemented Features\n\n| Name | Model | Feature | Animation |\n| --- | :---: | :---: | :---: |\n| **Bones** |  |  |  |\n| - Rotation | + | + | + |\n| - Translation | + | + | + |\n| - Scale | + | + | + |\n| - Shear | + | - | - |\n| *Bones extras:* |  |  |  |\n| - Reflect | + | - | |\n| - Rotation Inheritance | + | - | |\n| - Scale Inheritance | + | - | |\n| - Reflect Inheritance | + | - | |\n| **Slots** |  |  |  |\n| - Attachment | + | + | + |\n| - Tint Color | + | + | +/- |\n| - Dark Tint Color | + | - |  |\n| **Skins** | + | + |  |\n| **Attachments** |  |  |  |\n| - Region | + | + |  |\n| - Mesh | + | - | - |\n| - Linked Mesh | + | - | - |\n| - Bounding Box | + | + | - |\n| - Path | + | - | - |\n| - Point | + | + |  |\n| - Clipping | + | - | - |\n| **Constraints** |  |  |  |\n| - IK Constraint | + | - | - |\n| - Transform Constraint | + | - | - |\n| - Path Constraint | + | - | - |\n| **Events** | + | + | + |\n| **Draw Order** | + | + | + |\n\n## Documentation\nThe Spine library is pretty well documented. You can find the documentation both in the source code files themselves and compile the documentation for displaying it in the Developer Documentation in Xcode.\n\nTo compile the documentation use the menu: `Product` \u003e `Build Documentation`\n\nOr use a shortcut: `ctrl` + `shift` + `command` + `D`\n\nAs a result, the Developer Documentation will open and you will see something like this:\n\n![Docs](images/spine_readme_docs.png)\n\n## System Requirements\n\n**Swift 5.0**\n* iOS 8.0+\n* macOS 10.10+\n* tvOS 9.0+\n* watchOS 3.0+\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n\n## Useful links\n\n* The official Spine iOS runtime: https://esotericsoftware.com/spine-ios\n* Spine user guide: http://esotericsoftware.com/spine-user-guide\n* Spine JSON format documentation: http://esotericsoftware.com/spine-json-format\n* Spine oficial runtimes: https://github.com/EsotericSoftware/spine-runtimes\n","funding_links":[],"categories":["Swift"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxgribov%2FSpine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxgribov%2FSpine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxgribov%2FSpine/lists"}