LoginSignup
8
11

More than 5 years have passed since last update.

CocoStudio2 for Macで書き出したcsbファイルをCocos2d-xで表示しタイムラインアニメーション再生をさせる

Posted at

Cocos2d-x3.3でCocoStudioのタイムラインアニメーションの再生方法

alt

#include

xxx.h
#include "cocostudio/CocoStudio.h"
#include "cocosGUI.h"
using namespace cocostudio;
using namespace timeline;

csbファイルを読み込み表示させる

xxx.cpp
Node *node = CSLoader::getInstance()->createNode( "UI/MainScene.csb" );
this->addChild( node );

タイムラインアニメーションを再生する

xxx.cpp
ActionTimeline* action = CSLoader::createTimeline( "UI/MainScene.csb" );
node->runAction( action );
action->gotoFrameAndPlay( 5, false );

action->gotoFrameAndPlay( 5, false )の第1引数で開始するフレームインデックスの指定と第2引数でリピートの指定が可能。

8
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
11