mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 09:16:01 +08:00
Use createWithFile instead of releasing.
This commit is contained in:
parent
6de19dc914
commit
1573d47bc6
@ -41,7 +41,7 @@ CCScene* ExampleLayer::scene () {
|
||||
bool ExampleLayer::init () {
|
||||
if (!CCLayer::init()) return false;
|
||||
|
||||
skeletonNode = new CCSkeletonAnimation("spineboy.json", "spineboy.atlas");
|
||||
skeletonNode = CCSkeletonAnimation::createWithFile("spineboy.json", "spineboy.atlas");
|
||||
skeletonNode->setMix("walk", "jump", 0.2f);
|
||||
skeletonNode->setMix("jump", "walk", 0.4f);
|
||||
|
||||
@ -62,7 +62,6 @@ bool ExampleLayer::init () {
|
||||
CCSize windowSize = CCDirector::sharedDirector()->getWinSize();
|
||||
skeletonNode->setPosition(ccp(windowSize.width / 2, 20));
|
||||
addChild(skeletonNode);
|
||||
skeletonNode->release();
|
||||
|
||||
scheduleUpdate();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user