SKSpriteBuddy is the framework to work with game assests generated by Sprite Buddy app within SpriteKit
based games.
Always that you export your assets on Sprite Buddy
, 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 SKSpriteBuddy
framework to instantiate entity's objects, load and set skins and load and run animations.
To run the example project, clone the repo, and run pod install
from the Example directory first.
SKSpriteBuddy is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'SKSpriteBuddy'
- 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
import SKSpriteBuddy
...
let entity = try await IAEntity(withName: "EntityName")
self.scene.addChild(entity)
try await entity.setSkin(named: "Dark_Knight")
// 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 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 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 "SKSpriteBuddy"
SKSpriteBuddy is available under the MIT license. See the LICENSE file for more info.