SKInkAnimator
SKInkAnimator is the framework to work with game assests generated by InkAnimator app in SpriteKit
based games.
Always that you export your assets on InkAnimator
, the iPad app exports a <EntityName>.xml
file that have all the information about the game element's structure, skins and animations. And your assets organized in folders that represents the entity's bones. Use SKInkAnimator
framework to instantiate entity's objects, load and set skins and load and run animations.
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Installation
SKInkAnimator is available through CocoaPods. To install it, simply add the following line to your Podfile:
How to use
- Drag and drop the
<EntityName>.xml
file into your SpriteKit project onXcode
. - Drag and drop the asset folders into the
Assets.xcassets
folder. - Use the SKInkAnimator API to instantiate entity objects, set skins and run animations
Instantiating an entity object:
import SKInkAnimator
...
let entity = try await IAEntity(withName: "EntityName")
self.scene.addChild(entity)
Setting entity's skins:
try await entity.setSkin(named: "Dark_Knight")
Running animations:
// run the animation once
try await entity.run(animationNamed: "Running")
// Run the animation 3 times
try await entity.run(animationNamed: "Idle" , times: 3)
// Run the animation forever
try await entity.runForever(animationNamed: "Running")
Preloading Skins:
// Preloading the textures for skin named "Knight"
try await entity.preload(skinNamed: "Knight")
// Preloading textures for a set of skins
try await entity.preload(skins: ["Dark_Knight", "Light_Knight", "Golden_Knight"])
// Releasing unused textures from memory
entity.releaseSkin(named: "Dark_Knight")
Preloading Animations:
// Preloading the animation named "Running"
try await entity.preload(animationNamed: "Running")
// Preloading a set of animations
try await entity.preload(animations: ["Running", "Idle"])
// Releasing unused animations from memory
entity.releaseAnimation(named: "Running")
pod "SKInkAnimator"
Author
License
SKInkAnimator is available under the MIT license. See the LICENSE file for more info.