From bc8ac2e379c482dff52d3dd97bb1f9b241b94178 Mon Sep 17 00:00:00 2001 From: badlogic Date: Tue, 28 Feb 2017 15:50:35 +0100 Subject: [PATCH 1/2] [cococs2dx] Reverted temporary changes to samples --- spine-cocos2dx/example/Classes/BatchingExample.cpp | 2 +- spine-cocos2dx/example/Classes/GoblinsExample.cpp | 8 ++++---- spine-cocos2dx/example/Classes/TankExample.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spine-cocos2dx/example/Classes/BatchingExample.cpp b/spine-cocos2dx/example/Classes/BatchingExample.cpp index ba14fd501..ee15868c1 100644 --- a/spine-cocos2dx/example/Classes/BatchingExample.cpp +++ b/spine-cocos2dx/example/Classes/BatchingExample.cpp @@ -74,7 +74,7 @@ bool BatchingExample::init () { skeletonNode->addAnimation(0, "jump", true, RandomHelper::random_int(0, 300) / 100.0f); skeletonNode->addAnimation(0, "run", true); - skeletonNode->setTwoColorTint(true); + // skeletonNode->setTwoColorTint(true); skeletonNode->setPosition(Vec2( RandomHelper::random_int(xMin, xMax), diff --git a/spine-cocos2dx/example/Classes/GoblinsExample.cpp b/spine-cocos2dx/example/Classes/GoblinsExample.cpp index 4f7d4f901..c3ad232c0 100644 --- a/spine-cocos2dx/example/Classes/GoblinsExample.cpp +++ b/spine-cocos2dx/example/Classes/GoblinsExample.cpp @@ -43,11 +43,11 @@ Scene* GoblinsExample::scene () { bool GoblinsExample::init () { if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false; - skeletonNode = SkeletonAnimation::createWithBinaryFile("TwoColorTest.skel", "TwoColorTest.atlas", 0.5f); - skeletonNode->setAnimation(0, "animation", true); - // skeletonNode->setSkin("goblin"); + skeletonNode = SkeletonAnimation::createWithJsonFile("goblins-mesh.json", "goblins.atlas", 1.5f); + skeletonNode->setAnimation(0, "walk", true); + skeletonNode->setSkin("goblin"); - skeletonNode->setPosition(Vec2(_contentSize.width / 2, _contentSize.height / 2)); + skeletonNode->setPosition(Vec2(_contentSize.width / 2, 20)); addChild(skeletonNode); scheduleUpdate(); diff --git a/spine-cocos2dx/example/Classes/TankExample.cpp b/spine-cocos2dx/example/Classes/TankExample.cpp index 72e0798ea..30fb80932 100644 --- a/spine-cocos2dx/example/Classes/TankExample.cpp +++ b/spine-cocos2dx/example/Classes/TankExample.cpp @@ -44,7 +44,7 @@ bool TankExample::init () { if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false; skeletonNode = SkeletonAnimation::createWithJsonFile("tank.json", "tank.atlas", 0.5f); - skeletonNode->setAnimation(0, "drive", true); + skeletonNode->setAnimation(0, "drive", true); skeletonNode->setPosition(Vec2(_contentSize.width / 2 + 400, 20)); addChild(skeletonNode); From 4fa4f9009efce058dd87660e9b35f6295ea6f7be Mon Sep 17 00:00:00 2001 From: badlogic Date: Tue, 28 Feb 2017 15:53:12 +0100 Subject: [PATCH 2/2] [cocos2dx] Updated README.md --- spine-cocos2dx/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spine-cocos2dx/README.md b/spine-cocos2dx/README.md index 0690693a2..1a0f9fa81 100644 --- a/spine-cocos2dx/README.md +++ b/spine-cocos2dx/README.md @@ -10,7 +10,7 @@ The Spine Runtimes are developed with the intent to be used with data exported f ## Spine version -spine-cocos2dx works with data exported from Spine 3.5.xx. +spine-cocos2dx works with data exported from Spine 3.6.xx. spine-cocos2dx supports all Spine features. @@ -69,6 +69,7 @@ The Spine cocos2d-x example works on Windows and Mac OS X. ## Notes - Images are premultiplied by cocos2d-x, so the Spine atlas images should *not* use premultiplied alpha. +- Two color tinting needs to be enabled on a per-skeleton basis. Call `SkeletonRenderer::setTwoColorTine(true)` or `SkeletonAnimation::setTwoColorTint(true)` after you created the skeleton instance. Note that two color tinting requires a custom shader and vertex format. Skeletons rendered with two color tinting can therefore not be batched with single color tinted skeletons or other 2D cocos2d-x elements like sprites. However, two-color tinted skeletons will be batched if possible when rendered after one another. ## Examples