Created
May 29, 2014 20:48
-
-
Save ricardoquesada/50d9abe42456c7c178a3 to your computer and use it in GitHub Desktop.
High Level API for cocos2d-x's 3d animations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// API to play 3d animations on Sprite3D | |
// | |
// create the sprite | |
auto sprite3d = Sprite3D::create(“duck.ckb”); | |
sprite3d->setPosition3D(0, 0, 0); | |
this->addChild(sprite3d); | |
// get the animation | |
auto animation3d = Animation3D::getOrCreate(“duck.ckb”, “jump”); | |
// create the Animate action | |
auto animate3d = Animate3D::create(animation3d); | |
// run it | |
sprite3d->runAction(animate3d); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment