- Düzenlendi
Cocos2d-x sort of working runtime
this is a dirty hook for cocos2d-x done on a hurry, it'll be rewritten again, but it kinda works now.
the objective is to make it easy and fast to use:
bool ScSpineBoy::init()
{
_boy = CCSpine::makeSpine("spineboy-skeleton.json", "boy.png", "boy.plist");
_boy->loadAnimation("spineboy-walk.json", "walk");
_boy->loadAnimation("spineboy-jump.json", "jump");
_boy->playAnimation("jump", 0, true);
CCSize stageSize = CCDirector::sharedDirector()->getWinSize();
_boy->setPosition(stageSize.width * 0.5, stageSize.height * 0.1);
addChild(_boy);
scheduleUpdate();
return true;
}
void ScSpineBoy::update(float delta)
{
_boy->update(delta);
}
and yeah it forces the usage of a texture atlas, I used Texture Packer.
There is also this: https://github.com/seekagain/spine-runt ... c/spine-cc
I'll be doing the official runtime soon.