From 44ba6c48326376fe4785cd6816ce0a0e8b6180db Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Sun, 19 Jan 2014 19:26:07 +0100 Subject: [PATCH] Documentation --- spine-as3/README.md | 7 +++++-- spine-c/README.md | 37 ++++++++++++++++++++-------------- spine-cocos2d-iphone/README.md | 16 ++++++++++++++- spine-cocos2dx/README.md | 18 +++++++++++++++++ spine-turbulenz/README.md | 2 +- 5 files changed, 61 insertions(+), 19 deletions(-) create mode 100644 spine-cocos2dx/README.md diff --git a/spine-as3/README.md b/spine-as3/README.md index 7e43b94b6..56f5f17d9 100644 --- a/spine-as3/README.md +++ b/spine-as3/README.md @@ -1,10 +1,13 @@ # `spine-as3` -The `spine-as3` runtime provides basic functionality to load and manipulate [Spine](http://esotericsoftware.com) skeletal animation data using Adobe's ActionScript 3.0 (AS3). The [`spine.flash` package](https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-as3/spine-as3/src/spine/flash) can be used to render Spine animations using Flash, or `spine-as3` can be extended to enable Spine animations for other AS3 projects, such as [Starling](https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-starling). +The spine-as3 runtime provides basic functionality to load and manipulate [Spine](http://esotericsoftware.com) skeletal animation data using Adobe's ActionScript 3.0 (AS3). The [`spine.flash` package](https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-as3/spine-as3/src/spine/flash) can be used to render Spine animations using Flash, or spine-as3 can be extended to enable Spine animations for other AS3 projects, such as [Starling](https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-starling). ## Setup -Project files are provided for Adobe Flash Builder 4.6. +1. Download the Spine Runtimes source using [git](https://help.github.com/articles/set-up-git) or by downloading it [as a zip](https://github.com/EsotericSoftware/spine-runtimes/archive/master.zip). +1. Project files are provided for Adobe Flash Builder 4.6. You will need to create a new project and import the source for other IDEs. + +Alternatively, the contents of the `spine-as3/src` directory can be copied into your project. ## Demos diff --git a/spine-c/README.md b/spine-c/README.md index aad05b204..61d15525c 100644 --- a/spine-c/README.md +++ b/spine-c/README.md @@ -1,12 +1,15 @@ -# `spine-c` +# spine-c -The `spine-c` runtime provides basic functionality to load and manipulate [Spine](http://esotericsoftware.com) skeletal animation data using ANSI C. It does not perform rendering but can can be extended to enable Spine animations for any C-based language, such as C++ or Objective-C. +The spine-c runtime provides basic functionality to load and manipulate [Spine](http://esotericsoftware.com) skeletal animation data using ANSI C. It does not perform rendering but can can be extended to enable Spine animations for any C-based language, such as C++ or Objective-C. ## Setup -Project files are provided for Visual C++ Express 2010. +1. Download the Spine Runtimes source using [git](https://help.github.com/articles/set-up-git) or by downloading it [as a zip](https://github.com/EsotericSoftware/spine-runtimes/archive/master.zip). +1. Project files are provided for Visual C++ Express 2010. You will need to create a new project and import the source for other IDEs. -If `SPINE_SHORT_NAMES` is defined, the `sp` prefix for all structs and functions is optional. +Alternatively, the contents of the `spine-c/src` and `spine-c/include` directories can be copied into your project. Be sure your header search is configured to find the contents of the `spine-c/include` directory. Note that the includes use `spine/Xxx.h`, so the `spine` directory cannot be omitted when copying the files. + +If `SPINE_SHORT_NAMES` is defined, the `sp` prefix for all structs and functions is optional. Only use this if the spine-c names won't cause a conflict. ## Examples @@ -14,19 +17,23 @@ If `SPINE_SHORT_NAMES` is defined, the `sp` prefix for all structs and functions ## Extension -Extending `spine-c` requires implementing three methods: +Extending spine-c requires implementing three methods: -- **`_spAtlasPage_createTexture`** Loads a texture and stores it in the `void* rendererObject` field of an `spAtlasPage` struct. -- **`_spAtlasPage_disposeTexture`** Disposes of a texture loaded with `_spAtlasPage_createTexture`. -- **`_spUtil_readFile`** Reads a file. If this doesn't need to be customized, `_readFile` is provided which reads a file using `fopen`. +- `_spAtlasPage_createTexture` Loads a texture and stores it and its size in the `void* rendererObject`, `width` and `height` fields of an `spAtlasPage` struct. +- `_spAtlasPage_disposeTexture` Disposes of a texture loaded with `_spAtlasPage_createTexture`. +- `_spUtil_readFile` Reads a file. If this doesn't need to be customized, `_readFile` is provided which reads a file using `fopen`. -This allows the `spine-c` API to be used to load Spine animation data. Rendering is done by iterating the slots of a skeleton and rendering the attachment for each slot. [`spine-sfml`](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-sfml/src/spine/spine-sfml.cpp#L39) serves as a simple example of extending `spine-c`. +With these implemented, the spine-c API can then be used to load Spine animation data. Rendering is done by enumerating the slots for a skeleton and rendering the attachment for each slot. Each attachment has a `rendererObject` field that is set when the attachment is loaded. -`spine-c` uses an OOP style of programming where each "class" is made up of a struct and a number of functions prefixed with the struct name. More detals about how this works are available in [extension.h](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-c/include/spine/extension.h#L2). This mechanism allows you to provide your own implementations for [spAttachmentLoader](http://esotericsoftware.com/spine-using-runtimes/#attachmentloader), `spAttachment` and `spTimeline`, if necessary. +For example, `AtlasAttachmentLoader` is typically used to load attachments when using a Spine texture atlas. When `AtlasAttachmentLoader` loads a `RegionAttachment`, the attachment's `void* rendererObject` is set to an `AtlasRegion`. Rendering code can then obtain the `AtlasRegion` from the attachment, get the `AtlasPage` it belongs to, and get the page's `void* rendererObject`. This is the renderer specific texture object set by `_spAtlasPage_createTexture`. Attachment loading can be [customized](http://esotericsoftware.com/spine-using-runtimes/#attachmentloader) if not using `AtlasAttachmentLoader` or to provider different renderer specific data. -## Runtimes Extending `spine-c` +[spine-sfml](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-sfml/src/spine/spine-sfml.cpp#L39) serves as a simple example of extending spine-c. -- [`spine-cocos2d-iphone`](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2d-iphone) -- [`spine-cocos2dx`](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2dx) -- [`spine-sfml`](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-sfml) -- [`spine-torque2d`](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-torque2d) +spine-c uses an OOP style of programming where each "class" is made up of a struct and a number of functions prefixed with the struct name. More detals about how this works are available in [extension.h](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-c/include/spine/extension.h#L2). This mechanism allows you to provide your own implementations for `spAttachmentLoader`, `spAttachment` and `spTimeline`, if necessary. + +## Runtimes Extending spine-c + +- [spine-cocos2d-iphone](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2d-iphone) +- [spine-cocos2dx](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2dx) +- [spine-sfml](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-sfml) +- [spine-torque2d](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-torque2d) diff --git a/spine-cocos2d-iphone/README.md b/spine-cocos2d-iphone/README.md index 94f750cd9..79c080eac 100644 --- a/spine-cocos2d-iphone/README.md +++ b/spine-cocos2d-iphone/README.md @@ -1,2 +1,16 @@ -https://github.com/ldomaradzki/spine-runtimes/blob/master/Spine-Cocos2d-iPhone.podspec +# spine-cocos2d-iphone + +The spine-cocos2d-iphone runtime provides basic functionality to load and manipulate [Spine](http://esotericsoftware.com) skeletal animation data using [cocos2d-iphone](http://www.cocos2d-iphone.org/). spine-cocos2d-iphone is based on [spine-c](https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-c). + +## Setup + +1. Download the Spine Runtimes source using [git](https://help.github.com/articles/set-up-git) or by downloading it [as a zip](https://github.com/EsotericSoftware/spine-runtimes/archive/master.zip). +1. Place the `cocos2dx` directory from a cocos2d-x (cocos2d-2.1rc0-x-2.1.2 or later) distribution into the `spine-cocos2dx` directory. +1. Open the provided XCode (Mac) or Visual Studio Express 2012 (Windows) project file from the `example` directory. Build files are also provided for Android. + +Alternatively, the contents of the `spine-c/src`, `spine-c/include` and `spine-cocos2dx/src` directories can be copied into your project. Be sure your header search is configured to find the contents of the `spine-c/include` and `spine-cocos2dx/src` directories. Note that the includes use `spine/Xxx.h`, so the `spine` directory cannot be omitted when copying the files. + +## Examples + +[Simple example](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2dx/example/Classes/ExampleLayer.cpp#L18) diff --git a/spine-cocos2dx/README.md b/spine-cocos2dx/README.md new file mode 100644 index 000000000..16dc9c4b4 --- /dev/null +++ b/spine-cocos2dx/README.md @@ -0,0 +1,18 @@ + +# spine-cocos2dx + +The spine-cocos2dx runtime provides basic functionality to load and manipulate [Spine](http://esotericsoftware.com) skeletal animation data using [cocos2d-x](http://www.cocos2d-x.org/). spine-cocos2dx is based on [spine-c](https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-c). + +## Setup + +1. Download the Spine Runtimes source using [git](https://help.github.com/articles/set-up-git) or by downloading it [as a zip](https://github.com/EsotericSoftware/spine-runtimes/archive/master.zip). +1. Place the `cocos2d`, `CocosDenshion`, and `kazmath` directories from a cocos2d-iphone (v2.1-rc1 or later) distribution into the `spine-cocos2d-iphone/libs` directory. +1. Open the provided XCode project file for iOS or Mac. + +## Examples + +[Simple example](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2d-iphone/example/ExampleLayer.m#L13) + +## Links + +[podspec](https://github.com/ldomaradzki/spine-runtimes/blob/master/Spine-Cocos2d-iPhone.podspec) diff --git a/spine-turbulenz/README.md b/spine-turbulenz/README.md index 1ecc3b71a..9501634ea 100644 --- a/spine-turbulenz/README.md +++ b/spine-turbulenz/README.md @@ -1,6 +1,6 @@ # spine-turbulenz -The Spine runtime for [Turbulenz](http://biz.turbulenz.com/developers) is based on [spine-js](https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-js). +The spine-turbulenz runtime provides basic functionality to load and manipulate [Spine](http://esotericsoftware.com) skeletal animation data using [Turbulenz](http://biz.turbulenz.com/developers). spine-turbulenz is based on [spine-js](https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-js). ## Setup