mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Merge branch '3.6-beta' of https://github.com/EsotericSoftware/spine-runtimes into 3.6-beta
This commit is contained in:
commit
54de3b2b5e
@ -10,7 +10,7 @@ The Spine Runtimes are developed with the intent to be used with data exported f
|
|||||||
|
|
||||||
## Spine version
|
## 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.
|
spine-cocos2dx supports all Spine features.
|
||||||
|
|
||||||
@ -69,6 +69,7 @@ The Spine cocos2d-x example works on Windows and Mac OS X.
|
|||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
- Images are premultiplied by cocos2d-x, so the Spine atlas images should *not* use premultiplied alpha.
|
- 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
|
## Examples
|
||||||
|
|
||||||
|
|||||||
@ -74,7 +74,7 @@ bool BatchingExample::init () {
|
|||||||
skeletonNode->addAnimation(0, "jump", true, RandomHelper::random_int(0, 300) / 100.0f);
|
skeletonNode->addAnimation(0, "jump", true, RandomHelper::random_int(0, 300) / 100.0f);
|
||||||
skeletonNode->addAnimation(0, "run", true);
|
skeletonNode->addAnimation(0, "run", true);
|
||||||
|
|
||||||
skeletonNode->setTwoColorTint(true);
|
// skeletonNode->setTwoColorTint(true);
|
||||||
|
|
||||||
skeletonNode->setPosition(Vec2(
|
skeletonNode->setPosition(Vec2(
|
||||||
RandomHelper::random_int(xMin, xMax),
|
RandomHelper::random_int(xMin, xMax),
|
||||||
|
|||||||
@ -43,11 +43,11 @@ Scene* GoblinsExample::scene () {
|
|||||||
bool GoblinsExample::init () {
|
bool GoblinsExample::init () {
|
||||||
if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false;
|
if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false;
|
||||||
|
|
||||||
skeletonNode = SkeletonAnimation::createWithBinaryFile("TwoColorTest.skel", "TwoColorTest.atlas", 0.5f);
|
skeletonNode = SkeletonAnimation::createWithJsonFile("goblins-mesh.json", "goblins.atlas", 1.5f);
|
||||||
skeletonNode->setAnimation(0, "animation", true);
|
skeletonNode->setAnimation(0, "walk", true);
|
||||||
// skeletonNode->setSkin("goblin");
|
skeletonNode->setSkin("goblin");
|
||||||
|
|
||||||
skeletonNode->setPosition(Vec2(_contentSize.width / 2, _contentSize.height / 2));
|
skeletonNode->setPosition(Vec2(_contentSize.width / 2, 20));
|
||||||
addChild(skeletonNode);
|
addChild(skeletonNode);
|
||||||
|
|
||||||
scheduleUpdate();
|
scheduleUpdate();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user