Skip to content

Latest commit

 

History

History
 
 

spine-cocos2d-objc

spine-cocos2d-objc

The spine-cocos2d-objc runtime provides functionality to load, manipulate and render Spine skeletal animation data using the latest cocos2d-objc. spine-cocos2d-objc is based on spine-c.

Licensing

You are welcome to evaluate the Spine Runtimes and the examples we provide in this repository free of charge.

You can integrate the Spine Runtimes into your software free of charge, but users of your software must have their own Spine license. Please make your users aware of this requirement! This option is often chosen by those making development tools, such as an SDK, game toolkit, or software library.

In order to distribute your software containing the Spine Runtimes to others that don't have a Spine license, you need a Spine license at the time of integration. Then you can distribute your software containing the Spine Runtimes however you like, provided others don't modify it or use it to create new software. If others want to do that, they'll need their own Spine license.

For the official legal terms governing the Spine Runtimes, please read the Spine Runtimes License Agreement and Section 2 of the Spine Editor License Agreement.

Spine version

spine-cocos2d-objc works with data exported from Spine 3.9.x.

spine-cocos2d-objc supports all Spine features.

spine-cocos2d-objc does not yet support loading the binary format.

Usage

  1. Create a new cocos2d-obj project. See the cocos2d-objc documentation or have a look at the example in this repository.
  2. Download the Spine Runtimes source using git (git clone https://github.com/esotericsoftware/spine-runtimes) or download it as a zip via the download button above.
  3. Add the sources from spine-c/spine-c/src/spine and spine-cocos2d-objc/src/spine to your project
  4. Add the folders spine-c/spine-c/include and spine-cocos2d-objc/src to your header search path. Note that includes are specified as #inclue <spine/file.h>, so the spine directory cannot be omitted when copying the source files.
  5. If your project uses ARC, you have to exclude the .m files in spine-cocos2d-objc/src from ARC. See https://stackoverflow.com/questions/6646052/how-can-i-disable-arc-for-a-single-file-in-a-project for more information.

See the Spine Runtimes documentation on how to use the APIs or check out the Spine cocos2d-objc example.

Examples

The Spine cocos2d-objc example works on iOS simulators and devices.

Notes

  • To enable two color tinting, set SkeletonRenderer.twoColorTint = true. Note that skeletons rendered with this feature will not batch with other skeletons.

iOS

  1. Install Xcode
  2. Install Homebrew
  3. Open a terminal and install CMake via brew install cmake
  4. Download the Spine Runtimes repository using git (git clone https://github.com/esotericsoftware/spine-runtimes) or download it as a zip via the download button above.
  5. Open a terminal, and cd into the spine-runtimes/spine-cocos2d-objc folder
  6. Type mkdir build && cd build && cmake .., this will download the cocos2d-objc dependency
  7. Open the Xcode project in spine-runtimes/spine-cocos2d-objc/spine-cocos2d-objc.xcodeproj/
  8. In the file spine-runtimes/spine-cocos2d-objc/cocos2d/cocos2d/CCRendererBasicTypes.m, change line 56 from -(id)objectForKey:(id<NSCopying>)options to -(id)objectForKey:(id)options. This will allow building cocos2d-objc with the latest Xcode version.
  9. In Xcode, click the Run button or type CMD+R to run the example on the simulator

Links

podspec (maintained externally)