mirror of https://github.com/axmolengine/axmol.git
change TimelineAction to cocos/2d folder
This commit is contained in:
parent
75ff67c0ec
commit
e0f6ae9db4
|
@ -22,14 +22,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "CCFrame.h"
|
#include "2d/CCFrame.h"
|
||||||
#include "CCTimeLine.h"
|
#include "2d/CCTimeLine.h"
|
||||||
#include "CCTimelineAction.h"
|
#include "2d/CCTimelineAction.h"
|
||||||
|
#include "2d/CCSprite.h"
|
||||||
|
#include "2d/CCSpriteFrameCache.h"
|
||||||
|
|
||||||
using namespace cocos2d;
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace cocostudio {
|
|
||||||
namespace timeline{
|
|
||||||
|
|
||||||
// Frame
|
// Frame
|
||||||
Frame::Frame()
|
Frame::Frame()
|
||||||
|
@ -105,7 +104,7 @@ TextureFrame::TextureFrame()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextureFrame::setNode(cocos2d::Node* node)
|
void TextureFrame::setNode(Node* node)
|
||||||
{
|
{
|
||||||
Frame::setNode(node);
|
Frame::setNode(node);
|
||||||
|
|
||||||
|
@ -526,7 +525,7 @@ void ColorFrame::onEnter(Frame *nextFrame)
|
||||||
{
|
{
|
||||||
_betweenAlpha = static_cast<ColorFrame*>(nextFrame)->_alpha - _alpha;
|
_betweenAlpha = static_cast<ColorFrame*>(nextFrame)->_alpha - _alpha;
|
||||||
|
|
||||||
const cocos2d::Color3B& color = static_cast<ColorFrame*>(nextFrame)->_color;
|
const Color3B& color = static_cast<ColorFrame*>(nextFrame)->_color;
|
||||||
_betweenRed = color.r - _color.r;
|
_betweenRed = color.r - _color.r;
|
||||||
_betweenGreen = color.g - _color.g;
|
_betweenGreen = color.g - _color.g;
|
||||||
_betweenBlue = color.b - _color.b;
|
_betweenBlue = color.b - _color.b;
|
||||||
|
@ -542,7 +541,7 @@ void ColorFrame::apply(float percent)
|
||||||
{
|
{
|
||||||
GLubyte alpha = _alpha + _betweenAlpha * percent;
|
GLubyte alpha = _alpha + _betweenAlpha * percent;
|
||||||
|
|
||||||
cocos2d::Color3B color;
|
Color3B color;
|
||||||
color.r = _color.r+ _betweenRed * percent;
|
color.r = _color.r+ _betweenRed * percent;
|
||||||
color.g = _color.g+ _betweenGreen * percent;
|
color.g = _color.g+ _betweenGreen * percent;
|
||||||
color.b = _color.b+ _betweenBlue * percent;
|
color.b = _color.b+ _betweenBlue * percent;
|
||||||
|
@ -637,5 +636,4 @@ Frame* ZOrderFrame::clone()
|
||||||
return frame;
|
return frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
NS_CC_END
|
||||||
}
|
|
|
@ -27,11 +27,11 @@ THE SOFTWARE.
|
||||||
|
|
||||||
#include "CCTimeLine.h"
|
#include "CCTimeLine.h"
|
||||||
|
|
||||||
namespace cocostudio {
|
NS_CC_BEGIN
|
||||||
namespace timeline{
|
|
||||||
|
|
||||||
|
class Sprite;
|
||||||
|
|
||||||
class Frame : public cocos2d::Ref
|
class CC_DLL Frame : public Ref
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -41,8 +41,8 @@ public:
|
||||||
virtual void setTimeline(Timeline* timeline) { _timeline = timeline; }
|
virtual void setTimeline(Timeline* timeline) { _timeline = timeline; }
|
||||||
virtual Timeline* getTimeline() { return _timeline; }
|
virtual Timeline* getTimeline() { return _timeline; }
|
||||||
|
|
||||||
virtual void setNode(cocos2d::Node* node) { _node = node; }
|
virtual void setNode(Node* node) { _node = node; }
|
||||||
virtual cocos2d::Node* getTimelineNode() const { return _node; }
|
virtual Node* getTimelineNode() const { return _node; }
|
||||||
|
|
||||||
virtual void setTween(bool tween) { _tween = tween; }
|
virtual void setTween(bool tween) { _tween = tween; }
|
||||||
virtual bool isTween()const { return _tween; }
|
virtual bool isTween()const { return _tween; }
|
||||||
|
@ -63,11 +63,11 @@ protected:
|
||||||
bool _tween;
|
bool _tween;
|
||||||
|
|
||||||
Timeline* _timeline;
|
Timeline* _timeline;
|
||||||
cocos2d::Node* _node;
|
Node* _node;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class VisibleFrame : public Frame
|
class CC_DLL VisibleFrame : public Frame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static VisibleFrame* create();
|
static VisibleFrame* create();
|
||||||
|
@ -85,14 +85,14 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class TextureFrame : public Frame
|
class CC_DLL TextureFrame : public Frame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static TextureFrame* create();
|
static TextureFrame* create();
|
||||||
|
|
||||||
TextureFrame();
|
TextureFrame();
|
||||||
|
|
||||||
virtual void setNode(cocos2d::Node* node);
|
virtual void setNode(Node* node);
|
||||||
|
|
||||||
virtual void onEnter(Frame *nextFrame) override;
|
virtual void onEnter(Frame *nextFrame) override;
|
||||||
virtual Frame* clone() override;
|
virtual Frame* clone() override;
|
||||||
|
@ -101,11 +101,11 @@ public:
|
||||||
inline std::string getTexture() const { return _texture; }
|
inline std::string getTexture() const { return _texture; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
cocos2d::Sprite* _sprite;
|
Sprite* _sprite;
|
||||||
std::string _texture;
|
std::string _texture;
|
||||||
};
|
};
|
||||||
|
|
||||||
class RotationFrame : public Frame
|
class CC_DLL RotationFrame : public Frame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static RotationFrame* create();
|
static RotationFrame* create();
|
||||||
|
@ -124,7 +124,7 @@ protected:
|
||||||
float _betwennRotation;
|
float _betwennRotation;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SkewFrame : public Frame
|
class CC_DLL SkewFrame : public Frame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static SkewFrame* create();
|
static SkewFrame* create();
|
||||||
|
@ -149,7 +149,7 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class RotationSkewFrame : public SkewFrame
|
class CC_DLL RotationSkewFrame : public SkewFrame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static RotationSkewFrame* create();
|
static RotationSkewFrame* create();
|
||||||
|
@ -162,7 +162,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class PositionFrame : public Frame
|
class CC_DLL PositionFrame : public Frame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static PositionFrame* create();
|
static PositionFrame* create();
|
||||||
|
@ -173,8 +173,8 @@ public:
|
||||||
virtual void apply(float percent) override;
|
virtual void apply(float percent) override;
|
||||||
virtual Frame* clone() override;
|
virtual Frame* clone() override;
|
||||||
|
|
||||||
inline void setPosition(const cocos2d::Point& position) { _position = position; }
|
inline void setPosition(const Point& position) { _position = position; }
|
||||||
inline cocos2d::Point getPosition() const { return _position; }
|
inline Point getPosition() const { return _position; }
|
||||||
|
|
||||||
inline void setX(float x) { _position.x = x; }
|
inline void setX(float x) { _position.x = x; }
|
||||||
inline void setY(float y) { _position.y = y; }
|
inline void setY(float y) { _position.y = y; }
|
||||||
|
@ -182,13 +182,13 @@ public:
|
||||||
inline float getX() { return _position.x; }
|
inline float getX() { return _position.x; }
|
||||||
inline float getY() { return _position.y; }
|
inline float getY() { return _position.y; }
|
||||||
protected:
|
protected:
|
||||||
cocos2d::Point _position;
|
Point _position;
|
||||||
float _betweenX;
|
float _betweenX;
|
||||||
float _betweenY;
|
float _betweenY;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class ScaleFrame : public Frame
|
class CC_DLL ScaleFrame : public Frame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static ScaleFrame* create();
|
static ScaleFrame* create();
|
||||||
|
@ -215,7 +215,7 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class AnchorPointFrame : public Frame
|
class CC_DLL AnchorPointFrame : public Frame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static AnchorPointFrame* create();
|
static AnchorPointFrame* create();
|
||||||
|
@ -225,11 +225,11 @@ public:
|
||||||
virtual void onEnter(Frame *nextFrame) override;
|
virtual void onEnter(Frame *nextFrame) override;
|
||||||
virtual Frame* clone() override;
|
virtual Frame* clone() override;
|
||||||
|
|
||||||
inline void setAnchorPoint(const cocos2d::Point& point) { _anchorPoint = point; }
|
inline void setAnchorPoint(const Point& point) { _anchorPoint = point; }
|
||||||
inline cocos2d::Point getAnchorPoint() const { return _anchorPoint; }
|
inline Point getAnchorPoint() const { return _anchorPoint; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
cocos2d::Point _anchorPoint;
|
Point _anchorPoint;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ enum InnerActionType
|
||||||
SingleFrame
|
SingleFrame
|
||||||
};
|
};
|
||||||
|
|
||||||
class InnerActionFrame : public Frame
|
class CC_DLL InnerActionFrame : public Frame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static InnerActionFrame* create();
|
static InnerActionFrame* create();
|
||||||
|
@ -262,7 +262,7 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class ColorFrame : public Frame
|
class CC_DLL ColorFrame : public Frame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static ColorFrame* create();
|
static ColorFrame* create();
|
||||||
|
@ -275,12 +275,12 @@ public:
|
||||||
inline void setAlpha(GLubyte alpha) { _alpha = alpha; }
|
inline void setAlpha(GLubyte alpha) { _alpha = alpha; }
|
||||||
inline GLubyte getAlpha() const { return _alpha; }
|
inline GLubyte getAlpha() const { return _alpha; }
|
||||||
|
|
||||||
inline void setColor(const cocos2d::Color3B& color) { _color = color; }
|
inline void setColor(const Color3B& color) { _color = color; }
|
||||||
inline cocos2d::Color3B getColor() const { return _color; }
|
inline Color3B getColor() const { return _color; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
GLubyte _alpha;
|
GLubyte _alpha;
|
||||||
cocos2d::Color3B _color;
|
Color3B _color;
|
||||||
|
|
||||||
int _betweenAlpha;
|
int _betweenAlpha;
|
||||||
int _betweenRed;
|
int _betweenRed;
|
||||||
|
@ -289,7 +289,7 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class EventFrame : public Frame
|
class CC_DLL EventFrame : public Frame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static EventFrame* create();
|
static EventFrame* create();
|
||||||
|
@ -306,7 +306,7 @@ protected:
|
||||||
std::string _event;
|
std::string _event;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ZOrderFrame : public Frame
|
class CC_DLL ZOrderFrame : public Frame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static ZOrderFrame* create();
|
static ZOrderFrame* create();
|
||||||
|
@ -323,8 +323,7 @@ protected:
|
||||||
int _zorder;
|
int _zorder;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
NS_CC_END
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif /*__CCFRAME_H__*/
|
#endif /*__CCFRAME_H__*/
|
|
@ -26,10 +26,7 @@ THE SOFTWARE.
|
||||||
#include "CCTimelineAction.h"
|
#include "CCTimelineAction.h"
|
||||||
#include "CCFrame.h"
|
#include "CCFrame.h"
|
||||||
|
|
||||||
using namespace cocos2d;
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace cocostudio {
|
|
||||||
namespace timeline{
|
|
||||||
|
|
||||||
Timeline* Timeline::create()
|
Timeline* Timeline::create()
|
||||||
{
|
{
|
||||||
|
@ -109,7 +106,7 @@ void Timeline::removeFrame(Frame* frame)
|
||||||
frame->setTimeline(NULL);
|
frame->setTimeline(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Timeline::setNode(cocos2d::Node* node)
|
void Timeline::setNode(Node* node)
|
||||||
{
|
{
|
||||||
for (auto frame : _frames)
|
for (auto frame : _frames)
|
||||||
{
|
{
|
||||||
|
@ -117,7 +114,7 @@ void Timeline::setNode(cocos2d::Node* node)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cocos2d::Node* Timeline::getNode()
|
Node* Timeline::getNode()
|
||||||
{
|
{
|
||||||
return _node;
|
return _node;
|
||||||
}
|
}
|
||||||
|
@ -248,5 +245,4 @@ void Timeline::updateCurrentKeyFrame(int frameIndex)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
NS_CC_END
|
||||||
}
|
|
|
@ -25,15 +25,14 @@ THE SOFTWARE.
|
||||||
#ifndef __CCTIMELINE_H__
|
#ifndef __CCTIMELINE_H__
|
||||||
#define __CCTIMELINE_H__
|
#define __CCTIMELINE_H__
|
||||||
|
|
||||||
#include "cocos2d.h"
|
#include "2d/CCNode.h"
|
||||||
|
|
||||||
namespace cocostudio {
|
NS_CC_BEGIN
|
||||||
namespace timeline{
|
|
||||||
|
|
||||||
class Frame;
|
class Frame;
|
||||||
class TimelineAction;
|
class TimelineAction;
|
||||||
|
|
||||||
class Timeline : public cocos2d::Ref
|
class CC_DLL Timeline : public Ref
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static Timeline* create();
|
static Timeline* create();
|
||||||
|
@ -44,8 +43,8 @@ public:
|
||||||
virtual void gotoFrame(int frameIndex);
|
virtual void gotoFrame(int frameIndex);
|
||||||
virtual void stepToFrame(int frameIndex);
|
virtual void stepToFrame(int frameIndex);
|
||||||
|
|
||||||
virtual cocos2d::Vector<Frame*>& getFrames() { return _frames; }
|
virtual Vector<Frame*>& getFrames() { return _frames; }
|
||||||
virtual const cocos2d::Vector<Frame*>& getFrames() const { return _frames; }
|
virtual const Vector<Frame*>& getFrames() const { return _frames; }
|
||||||
|
|
||||||
virtual void addFrame(Frame* frame);
|
virtual void addFrame(Frame* frame);
|
||||||
virtual void insertFrame(Frame* frame, int index);
|
virtual void insertFrame(Frame* frame, int index);
|
||||||
|
@ -54,8 +53,8 @@ public:
|
||||||
virtual void setActionTag(int tag) { _actionTag = tag; }
|
virtual void setActionTag(int tag) { _actionTag = tag; }
|
||||||
virtual int getActionTag() { return _actionTag; }
|
virtual int getActionTag() { return _actionTag; }
|
||||||
|
|
||||||
virtual void setNode(cocos2d::Node* node);
|
virtual void setNode(Node* node);
|
||||||
virtual cocos2d::Node* getNode();
|
virtual Node* getNode();
|
||||||
|
|
||||||
virtual void setTimelineAction(TimelineAction* action) { _timelineAction = action; }
|
virtual void setTimelineAction(TimelineAction* action) { _timelineAction = action; }
|
||||||
virtual TimelineAction* getTimelineAction() { return _timelineAction; }
|
virtual TimelineAction* getTimelineAction() { return _timelineAction; }
|
||||||
|
@ -69,7 +68,7 @@ protected:
|
||||||
virtual void binarySearchKeyFrame (int frameIndex);
|
virtual void binarySearchKeyFrame (int frameIndex);
|
||||||
virtual void updateCurrentKeyFrame(int frameIndex);
|
virtual void updateCurrentKeyFrame(int frameIndex);
|
||||||
|
|
||||||
cocos2d::Vector<Frame*> _frames;
|
Vector<Frame*> _frames;
|
||||||
Frame* _currentKeyFrame;
|
Frame* _currentKeyFrame;
|
||||||
int _currentKeyFrameIndex;
|
int _currentKeyFrameIndex;
|
||||||
|
|
||||||
|
@ -79,11 +78,10 @@ protected:
|
||||||
int _actionTag;
|
int _actionTag;
|
||||||
|
|
||||||
TimelineAction* _timelineAction;
|
TimelineAction* _timelineAction;
|
||||||
cocos2d::Node* _node;
|
Node* _node;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
NS_CC_END
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif /*__CCTIMELINE_H__*/
|
#endif /*__CCTIMELINE_H__*/
|
|
@ -23,13 +23,38 @@ THE SOFTWARE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "CCTimelineAction.h"
|
#include "CCTimelineAction.h"
|
||||||
#include "CCNodeReader.h"
|
|
||||||
|
|
||||||
using namespace cocos2d;
|
NS_CC_BEGIN
|
||||||
|
|
||||||
namespace cocostudio {
|
|
||||||
namespace timeline{
|
|
||||||
|
|
||||||
|
// TimelineActionData
|
||||||
|
TimelineActionData* TimelineActionData::create(int actionTag)
|
||||||
|
{
|
||||||
|
TimelineActionData * ret = new TimelineActionData();
|
||||||
|
if (ret && ret->init(actionTag))
|
||||||
|
{
|
||||||
|
ret->autorelease();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CC_SAFE_DELETE(ret);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
TimelineActionData::TimelineActionData()
|
||||||
|
: _actionTag(0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TimelineActionData::init(int actionTag)
|
||||||
|
{
|
||||||
|
_actionTag = actionTag;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// TimelineAction
|
||||||
TimelineAction* TimelineAction::create()
|
TimelineAction* TimelineAction::create()
|
||||||
{
|
{
|
||||||
TimelineAction* object = new TimelineAction();
|
TimelineAction* object = new TimelineAction();
|
||||||
|
@ -194,7 +219,7 @@ void TimelineAction::addTimeline(Timeline* timeline)
|
||||||
int tag = timeline->getActionTag();
|
int tag = timeline->getActionTag();
|
||||||
if (_timelineMap.find(tag) == _timelineMap.end())
|
if (_timelineMap.find(tag) == _timelineMap.end())
|
||||||
{
|
{
|
||||||
_timelineMap[tag] = cocos2d::Vector<Timeline*>();
|
_timelineMap[tag] = Vector<Timeline*>();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_timelineMap[tag].contains(timeline))
|
if (!_timelineMap[tag].contains(timeline))
|
||||||
|
@ -256,5 +281,4 @@ void TimelineAction::stepToFrame(int frameIndex)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
NS_CC_END
|
||||||
}
|
|
|
@ -25,17 +25,33 @@ THE SOFTWARE.
|
||||||
#ifndef __CCTIMELINE_ACTION_H__
|
#ifndef __CCTIMELINE_ACTION_H__
|
||||||
#define __CCTIMELINE_ACTION_H__
|
#define __CCTIMELINE_ACTION_H__
|
||||||
|
|
||||||
#include "cocos2d.h"
|
#include "2d/CCNode.h"
|
||||||
#include "CCTimeLine.h"
|
#include "2d/CCAction.h"
|
||||||
|
#include "2d/CCTimeLine.h"
|
||||||
|
#include "base/CCRef.h"
|
||||||
#include "renderer/CCRenderer.h"
|
#include "renderer/CCRenderer.h"
|
||||||
|
|
||||||
namespace cocostudio {
|
NS_CC_BEGIN
|
||||||
namespace timeline{
|
|
||||||
|
|
||||||
typedef void (cocos2d::Ref::*SEL_FrameEventCallFunc)(Frame *);
|
typedef void (Ref::*SEL_FrameEventCallFunc)(Frame *);
|
||||||
#define frameEvent_selector(_SELECTOR) (cocostudio::SEL_FrameEventCallFunc)(&_SELECTOR)
|
#define frameEvent_selector(_SELECTOR) (SEL_FrameEventCallFunc)(&_SELECTOR)
|
||||||
|
|
||||||
class TimelineAction : public cocos2d::Action
|
class CC_DLL TimelineActionData : public Ref
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static TimelineActionData* create(int actionTag);
|
||||||
|
|
||||||
|
virtual void setActionTag(int actionTag) { _actionTag = actionTag; }
|
||||||
|
virtual int getActionTag() { return _actionTag; }
|
||||||
|
protected:
|
||||||
|
TimelineActionData();
|
||||||
|
virtual bool init(int actionTag);
|
||||||
|
|
||||||
|
int _actionTag;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class CC_DLL TimelineAction : public Action
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static TimelineAction* create();
|
static TimelineAction* create();
|
||||||
|
@ -105,7 +121,7 @@ public:
|
||||||
/** emit frame event, call it when enter a frame*/
|
/** emit frame event, call it when enter a frame*/
|
||||||
void emitFrameEvent(Frame* frame);
|
void emitFrameEvent(Frame* frame);
|
||||||
|
|
||||||
/** Inherit from cocos2d::Action. */
|
/** Inherit from Action. */
|
||||||
|
|
||||||
/** Returns a clone of TimelineAction */
|
/** Returns a clone of TimelineAction */
|
||||||
virtual TimelineAction* clone() const override;
|
virtual TimelineAction* clone() const override;
|
||||||
|
@ -116,14 +132,14 @@ public:
|
||||||
virtual TimelineAction* reverse() const override { return nullptr; }
|
virtual TimelineAction* reverse() const override { return nullptr; }
|
||||||
|
|
||||||
virtual void step(float delta) override;
|
virtual void step(float delta) override;
|
||||||
virtual void startWithTarget(cocos2d::Node *target) override;
|
virtual void startWithTarget(Node *target) override;
|
||||||
virtual bool isDone() const override { return false; }
|
virtual bool isDone() const override { return false; }
|
||||||
protected:
|
protected:
|
||||||
virtual void gotoFrame(int frameIndex);
|
virtual void gotoFrame(int frameIndex);
|
||||||
virtual void stepToFrame(int frameIndex);
|
virtual void stepToFrame(int frameIndex);
|
||||||
|
|
||||||
std::map<int, cocos2d::Vector<Timeline*>> _timelineMap;
|
std::map<int, Vector<Timeline*>> _timelineMap;
|
||||||
cocos2d::Vector<Timeline*> _timelineList;
|
Vector<Timeline*> _timelineList;
|
||||||
|
|
||||||
int _duration;
|
int _duration;
|
||||||
double _time;
|
double _time;
|
||||||
|
@ -137,8 +153,7 @@ protected:
|
||||||
std::function<void(Frame*)> _frameEventListener;
|
std::function<void(Frame*)> _frameEventListener;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
NS_CC_END
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif /*__CCTIMELINE_ACTION_H__*/
|
#endif /*__CCTIMELINE_ACTION_H__*/
|
|
@ -303,6 +303,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
|
||||||
<ClCompile Include="CCFontCharMap.cpp" />
|
<ClCompile Include="CCFontCharMap.cpp" />
|
||||||
<ClCompile Include="CCFontFNT.cpp" />
|
<ClCompile Include="CCFontFNT.cpp" />
|
||||||
<ClCompile Include="CCFontFreeType.cpp" />
|
<ClCompile Include="CCFontFreeType.cpp" />
|
||||||
|
<ClCompile Include="CCFrame.cpp" />
|
||||||
<ClCompile Include="CCGLBufferedNode.cpp" />
|
<ClCompile Include="CCGLBufferedNode.cpp" />
|
||||||
<ClCompile Include="CCGrabber.cpp" />
|
<ClCompile Include="CCGrabber.cpp" />
|
||||||
<ClCompile Include="CCGrid.cpp" />
|
<ClCompile Include="CCGrid.cpp" />
|
||||||
|
@ -331,6 +332,8 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
|
||||||
<ClCompile Include="CCSpriteFrameCache.cpp" />
|
<ClCompile Include="CCSpriteFrameCache.cpp" />
|
||||||
<ClCompile Include="CCTextFieldTTF.cpp" />
|
<ClCompile Include="CCTextFieldTTF.cpp" />
|
||||||
<ClCompile Include="CCTileMapAtlas.cpp" />
|
<ClCompile Include="CCTileMapAtlas.cpp" />
|
||||||
|
<ClCompile Include="CCTimeLine.cpp" />
|
||||||
|
<ClCompile Include="CCTimelineAction.cpp" />
|
||||||
<ClCompile Include="CCTMXLayer.cpp" />
|
<ClCompile Include="CCTMXLayer.cpp" />
|
||||||
<ClCompile Include="CCTMXObjectGroup.cpp" />
|
<ClCompile Include="CCTMXObjectGroup.cpp" />
|
||||||
<ClCompile Include="CCTMXTiledMap.cpp" />
|
<ClCompile Include="CCTMXTiledMap.cpp" />
|
||||||
|
@ -499,6 +502,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
|
||||||
<ClInclude Include="CCFontCharMap.h" />
|
<ClInclude Include="CCFontCharMap.h" />
|
||||||
<ClInclude Include="CCFontFNT.h" />
|
<ClInclude Include="CCFontFNT.h" />
|
||||||
<ClInclude Include="CCFontFreeType.h" />
|
<ClInclude Include="CCFontFreeType.h" />
|
||||||
|
<ClInclude Include="CCFrame.h" />
|
||||||
<ClInclude Include="CCGLBufferedNode.h" />
|
<ClInclude Include="CCGLBufferedNode.h" />
|
||||||
<ClInclude Include="CCGrabber.h" />
|
<ClInclude Include="CCGrabber.h" />
|
||||||
<ClInclude Include="CCGrid.h" />
|
<ClInclude Include="CCGrid.h" />
|
||||||
|
@ -527,6 +531,8 @@ xcopy /Y /Q "$(ProjectDir)..\..\external\win32-specific\gles\prebuilt\*.*" "$(Ou
|
||||||
<ClInclude Include="CCSpriteFrameCache.h" />
|
<ClInclude Include="CCSpriteFrameCache.h" />
|
||||||
<ClInclude Include="CCTextFieldTTF.h" />
|
<ClInclude Include="CCTextFieldTTF.h" />
|
||||||
<ClInclude Include="CCTileMapAtlas.h" />
|
<ClInclude Include="CCTileMapAtlas.h" />
|
||||||
|
<ClInclude Include="CCTimeLine.h" />
|
||||||
|
<ClInclude Include="CCTimelineAction.h" />
|
||||||
<ClInclude Include="CCTMXLayer.h" />
|
<ClInclude Include="CCTMXLayer.h" />
|
||||||
<ClInclude Include="CCTMXObjectGroup.h" />
|
<ClInclude Include="CCTMXObjectGroup.h" />
|
||||||
<ClInclude Include="CCTMXTiledMap.h" />
|
<ClInclude Include="CCTMXTiledMap.h" />
|
||||||
|
|
|
@ -568,6 +568,15 @@
|
||||||
<ClCompile Include="..\base\ObjectFactory.cpp">
|
<ClCompile Include="..\base\ObjectFactory.cpp">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="CCFrame.cpp">
|
||||||
|
<Filter>2d</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="CCTimeLine.cpp">
|
||||||
|
<Filter>2d</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="CCTimelineAction.cpp">
|
||||||
|
<Filter>2d</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\physics\CCPhysicsBody.h">
|
<ClInclude Include="..\physics\CCPhysicsBody.h">
|
||||||
|
@ -1150,6 +1159,15 @@
|
||||||
<ClInclude Include="..\base\ObjectFactory.h">
|
<ClInclude Include="..\base\ObjectFactory.h">
|
||||||
<Filter>base</Filter>
|
<Filter>base</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="CCFrame.h">
|
||||||
|
<Filter>2d</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="CCTimeLine.h">
|
||||||
|
<Filter>2d</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="CCTimelineAction.h">
|
||||||
|
<Filter>2d</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="..\math\Mat4.inl">
|
<None Include="..\math\Mat4.inl">
|
||||||
|
|
|
@ -104,6 +104,9 @@ THE SOFTWARE.
|
||||||
#include "2d/CCActionTween.h"
|
#include "2d/CCActionTween.h"
|
||||||
#include "2d/CCActionCatmullRom.h"
|
#include "2d/CCActionCatmullRom.h"
|
||||||
#include "2d/CCTweenFunction.h"
|
#include "2d/CCTweenFunction.h"
|
||||||
|
#include "2d/CCFrame.h"
|
||||||
|
#include "2d/CCTimeLine.h"
|
||||||
|
#include "2d/CCTimelineAction.h"
|
||||||
|
|
||||||
// 2d nodes
|
// 2d nodes
|
||||||
#include "2d/CCNode.h"
|
#include "2d/CCNode.h"
|
||||||
|
|
|
@ -58,10 +58,7 @@ THE SOFTWARE.
|
||||||
#include "cocostudio/CCSGUIReader.h"
|
#include "cocostudio/CCSGUIReader.h"
|
||||||
#include "cocostudio/CCSSceneReader.h"
|
#include "cocostudio/CCSSceneReader.h"
|
||||||
#include "cocostudio/TriggerBase.h"
|
#include "cocostudio/TriggerBase.h"
|
||||||
#include "cocostudio/TimelineAction/CCFrame.h"
|
|
||||||
#include "cocostudio/TimelineAction/CCNodeReader.h"
|
#include "cocostudio/TimelineAction/CCNodeReader.h"
|
||||||
#include "cocostudio/TimelineAction/CCTimeLine.h"
|
|
||||||
#include "cocostudio/TimelineAction/CCTimelineAction.h"
|
|
||||||
#include "cocostudio/TimelineAction/CCTimelineActionCache.h"
|
#include "cocostudio/TimelineAction/CCTimelineActionCache.h"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -24,12 +24,11 @@ THE SOFTWARE.
|
||||||
|
|
||||||
#include "CCNodeReader.h"
|
#include "CCNodeReader.h"
|
||||||
#include "CCTimelineActionCache.h"
|
#include "CCTimelineActionCache.h"
|
||||||
#include "CCFrame.h"
|
|
||||||
|
|
||||||
#include "../CCSGUIReader.h"
|
#include "../CCSGUIReader.h"
|
||||||
|
|
||||||
using namespace cocos2d;
|
using namespace cocos2d;
|
||||||
using namespace cocos2d::ui;
|
using namespace ui;
|
||||||
|
|
||||||
namespace cocostudio {
|
namespace cocostudio {
|
||||||
namespace timeline{
|
namespace timeline{
|
||||||
|
@ -89,32 +88,6 @@ static const char* PARTICLE_NUM = "particleNum";
|
||||||
static const char* TEXTURES = "textures";
|
static const char* TEXTURES = "textures";
|
||||||
static const char* TEXTURES_PNG = "texturesPng";
|
static const char* TEXTURES_PNG = "texturesPng";
|
||||||
|
|
||||||
// TimelineActionData
|
|
||||||
TimelineActionData* TimelineActionData::create(int actionTag)
|
|
||||||
{
|
|
||||||
TimelineActionData * ret = new TimelineActionData();
|
|
||||||
if (ret && ret->init(actionTag))
|
|
||||||
{
|
|
||||||
ret->autorelease();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
CC_SAFE_DELETE(ret);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
TimelineActionData::TimelineActionData()
|
|
||||||
: _actionTag(0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TimelineActionData::init(int actionTag)
|
|
||||||
{
|
|
||||||
_actionTag = actionTag;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// NodeReader
|
// NodeReader
|
||||||
static NodeReader* _sharedNodeReader = nullptr;
|
static NodeReader* _sharedNodeReader = nullptr;
|
||||||
|
@ -173,7 +146,7 @@ void NodeReader::init()
|
||||||
_guiReader = new WidgetPropertiesReader0300();
|
_guiReader = new WidgetPropertiesReader0300();
|
||||||
}
|
}
|
||||||
|
|
||||||
cocos2d::Node* NodeReader::createNode(const std::string& filename)
|
Node* NodeReader::createNode(const std::string& filename)
|
||||||
{
|
{
|
||||||
if(_recordJsonPath)
|
if(_recordJsonPath)
|
||||||
{
|
{
|
||||||
|
@ -188,17 +161,17 @@ cocos2d::Node* NodeReader::createNode(const std::string& filename)
|
||||||
_jsonPath = "";
|
_jsonPath = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
cocos2d::Node* node = loadNodeWithFile(filename);
|
Node* node = loadNodeWithFile(filename);
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
cocos2d::Node* NodeReader::loadNodeWithFile(const std::string& fileName)
|
Node* NodeReader::loadNodeWithFile(const std::string& fileName)
|
||||||
{
|
{
|
||||||
// Read content from file
|
// Read content from file
|
||||||
std::string contentStr = FileUtils::getInstance()->getStringFromFile(fileName);
|
std::string contentStr = FileUtils::getInstance()->getStringFromFile(fileName);
|
||||||
|
|
||||||
cocos2d::Node* node = loadNodeWithContent(contentStr);
|
Node* node = loadNodeWithContent(contentStr);
|
||||||
|
|
||||||
// Load animation data from file
|
// Load animation data from file
|
||||||
TimelineActionCache::getInstance()->loadAnimationActionWithContent(fileName, contentStr);
|
TimelineActionCache::getInstance()->loadAnimationActionWithContent(fileName, contentStr);
|
||||||
|
@ -206,7 +179,7 @@ cocos2d::Node* NodeReader::loadNodeWithFile(const std::string& fileName)
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
cocos2d::Node* NodeReader::loadNodeWithContent(const std::string& content)
|
Node* NodeReader::loadNodeWithContent(const std::string& content)
|
||||||
{
|
{
|
||||||
rapidjson::Document doc;
|
rapidjson::Document doc;
|
||||||
doc.Parse<0>(content.c_str());
|
doc.Parse<0>(content.c_str());
|
||||||
|
@ -229,15 +202,15 @@ cocos2d::Node* NodeReader::loadNodeWithContent(const std::string& content)
|
||||||
|
|
||||||
// decode node tree
|
// decode node tree
|
||||||
const rapidjson::Value& subJson = DICTOOL->getSubDictionary_json(doc, NODE);
|
const rapidjson::Value& subJson = DICTOOL->getSubDictionary_json(doc, NODE);
|
||||||
cocos2d::Node* root = loadNode(subJson);
|
Node* root = loadNode(subJson);
|
||||||
root->release();
|
root->release();
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
cocos2d::Node* NodeReader::loadNode(const rapidjson::Value& json)
|
Node* NodeReader::loadNode(const rapidjson::Value& json)
|
||||||
{
|
{
|
||||||
cocos2d::Node* node = nullptr;
|
Node* node = nullptr;
|
||||||
std::string nodeType = DICTOOL->getStringValue_json(json, CLASSNAME);
|
std::string nodeType = DICTOOL->getStringValue_json(json, CLASSNAME);
|
||||||
|
|
||||||
NodeCreateFunc func = _funcs.at(nodeType);
|
NodeCreateFunc func = _funcs.at(nodeType);
|
||||||
|
@ -253,7 +226,7 @@ cocos2d::Node* NodeReader::loadNode(const rapidjson::Value& json)
|
||||||
for (int i = 0; i<length; i++)
|
for (int i = 0; i<length; i++)
|
||||||
{
|
{
|
||||||
const rapidjson::Value &dic = DICTOOL->getSubDictionary_json(json, CHILDREN, i);
|
const rapidjson::Value &dic = DICTOOL->getSubDictionary_json(json, CHILDREN, i);
|
||||||
cocos2d::Node* child = loadNode(dic);
|
Node* child = loadNode(dic);
|
||||||
if (child)
|
if (child)
|
||||||
{
|
{
|
||||||
node->addChild(child);
|
node->addChild(child);
|
||||||
|
@ -269,7 +242,7 @@ cocos2d::Node* NodeReader::loadNode(const rapidjson::Value& json)
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NodeReader::initNode(cocos2d::Node* node, const rapidjson::Value& json)
|
void NodeReader::initNode(Node* node, const rapidjson::Value& json)
|
||||||
{
|
{
|
||||||
float width = DICTOOL->getFloatValue_json(json, WIDTH);
|
float width = DICTOOL->getFloatValue_json(json, WIDTH);
|
||||||
float height = DICTOOL->getFloatValue_json(json, HEIGHT);
|
float height = DICTOOL->getFloatValue_json(json, HEIGHT);
|
||||||
|
@ -338,7 +311,7 @@ Node* NodeReader::loadSimpleNode(const rapidjson::Value& json)
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
cocos2d::Node* NodeReader::loadSubGraph(const rapidjson::Value& json)
|
Node* NodeReader::loadSubGraph(const rapidjson::Value& json)
|
||||||
{
|
{
|
||||||
const char* filePath = DICTOOL->getStringValue_json(json, FILE_PATH);
|
const char* filePath = DICTOOL->getStringValue_json(json, FILE_PATH);
|
||||||
|
|
||||||
|
@ -411,7 +384,7 @@ Node* NodeReader::loadParticle(const rapidjson::Value& json)
|
||||||
return particle;
|
return particle;
|
||||||
}
|
}
|
||||||
|
|
||||||
cocos2d::Node* NodeReader::loadWidget(const rapidjson::Value& json)
|
Node* NodeReader::loadWidget(const rapidjson::Value& json)
|
||||||
{
|
{
|
||||||
const char* str = DICTOOL->getStringValue_json(json, CLASSNAME);
|
const char* str = DICTOOL->getStringValue_json(json, CLASSNAME);
|
||||||
if(str == nullptr)
|
if(str == nullptr)
|
||||||
|
|
|
@ -25,9 +25,8 @@ THE SOFTWARE.
|
||||||
#ifndef __CC_NODE_CACHE_H__
|
#ifndef __CC_NODE_CACHE_H__
|
||||||
#define __CC_NODE_CACHE_H__
|
#define __CC_NODE_CACHE_H__
|
||||||
|
|
||||||
#include "CCTimeLine.h"
|
|
||||||
#include "cocostudio/DictionaryHelper.h"
|
#include "cocostudio/DictionaryHelper.h"
|
||||||
|
#include "cocos2d.h"
|
||||||
|
|
||||||
namespace cocostudio {
|
namespace cocostudio {
|
||||||
|
|
||||||
|
@ -35,20 +34,6 @@ class WidgetPropertiesReader0300;
|
||||||
|
|
||||||
namespace timeline{
|
namespace timeline{
|
||||||
|
|
||||||
class TimelineActionData : public cocos2d::Ref
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static TimelineActionData* create(int actionTag);
|
|
||||||
|
|
||||||
virtual void setActionTag(int actionTag) { _actionTag = actionTag; }
|
|
||||||
virtual int getActionTag() { return _actionTag; }
|
|
||||||
protected:
|
|
||||||
TimelineActionData();
|
|
||||||
virtual bool init(int actionTag);
|
|
||||||
|
|
||||||
int _actionTag;
|
|
||||||
};
|
|
||||||
|
|
||||||
class NodeReader
|
class NodeReader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -23,8 +23,6 @@ THE SOFTWARE.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "CCTimelineActionCache.h"
|
#include "CCTimelineActionCache.h"
|
||||||
#include "CCTimelineAction.h"
|
|
||||||
#include "CCFrame.h"
|
|
||||||
#include "CCNodeReader.h"
|
#include "CCNodeReader.h"
|
||||||
|
|
||||||
using namespace cocos2d;
|
using namespace cocos2d;
|
||||||
|
|
|
@ -28,13 +28,10 @@ THE SOFTWARE.
|
||||||
#include "cocos2d.h"
|
#include "cocos2d.h"
|
||||||
#include "cocostudio/DictionaryHelper.h"
|
#include "cocostudio/DictionaryHelper.h"
|
||||||
|
|
||||||
#include "CCTimeLine.h"
|
|
||||||
|
|
||||||
namespace cocostudio {
|
namespace cocostudio {
|
||||||
namespace timeline{
|
namespace timeline{
|
||||||
|
|
||||||
class TimelineAction;
|
|
||||||
|
|
||||||
class TimelineActionCache
|
class TimelineActionCache
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -52,34 +49,34 @@ public:
|
||||||
void removeAction(const std::string& fileName);
|
void removeAction(const std::string& fileName);
|
||||||
|
|
||||||
/** Clone a action with the specified name from the container. */
|
/** Clone a action with the specified name from the container. */
|
||||||
TimelineAction* createAction(const std::string& fileName);
|
cocos2d::TimelineAction* createAction(const std::string& fileName);
|
||||||
|
|
||||||
TimelineAction* loadAnimationActionWithFile(const std::string& fileName);
|
cocos2d::TimelineAction* loadAnimationActionWithFile(const std::string& fileName);
|
||||||
TimelineAction* loadAnimationActionWithContent(const std::string&fileName, const std::string& content);
|
cocos2d::TimelineAction* loadAnimationActionWithContent(const std::string&fileName, const std::string& content);
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
Timeline* loadTimeline(const rapidjson::Value& json);
|
cocos2d::Timeline* loadTimeline(const rapidjson::Value& json);
|
||||||
|
|
||||||
Frame* loadVisibleFrame (const rapidjson::Value& json);
|
cocos2d::Frame* loadVisibleFrame (const rapidjson::Value& json);
|
||||||
Frame* loadPositionFrame (const rapidjson::Value& json);
|
cocos2d::Frame* loadPositionFrame (const rapidjson::Value& json);
|
||||||
Frame* loadScaleFrame (const rapidjson::Value& json);
|
cocos2d::Frame* loadScaleFrame (const rapidjson::Value& json);
|
||||||
Frame* loadSkewFrame (const rapidjson::Value& json);
|
cocos2d::Frame* loadSkewFrame (const rapidjson::Value& json);
|
||||||
Frame* loadRotationSkewFrame(const rapidjson::Value& json);
|
cocos2d::Frame* loadRotationSkewFrame(const rapidjson::Value& json);
|
||||||
Frame* loadRotationFrame (const rapidjson::Value& json);
|
cocos2d::Frame* loadRotationFrame (const rapidjson::Value& json);
|
||||||
Frame* loadAnchorPointFrame (const rapidjson::Value& json);
|
cocos2d::Frame* loadAnchorPointFrame (const rapidjson::Value& json);
|
||||||
Frame* loadInnerActionFrame (const rapidjson::Value& json);
|
cocos2d::Frame* loadInnerActionFrame (const rapidjson::Value& json);
|
||||||
Frame* loadColorFrame (const rapidjson::Value& json);
|
cocos2d::Frame* loadColorFrame (const rapidjson::Value& json);
|
||||||
Frame* loadTextureFrame (const rapidjson::Value& json);
|
cocos2d::Frame* loadTextureFrame (const rapidjson::Value& json);
|
||||||
Frame* loadEventFrame (const rapidjson::Value& json);
|
cocos2d::Frame* loadEventFrame (const rapidjson::Value& json);
|
||||||
Frame* loadZOrderFrame (const rapidjson::Value& json);
|
cocos2d::Frame* loadZOrderFrame (const rapidjson::Value& json);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
typedef std::function<Frame*(const rapidjson::Value& json)> FrameCreateFunc;
|
typedef std::function<cocos2d::Frame*(const rapidjson::Value& json)> FrameCreateFunc;
|
||||||
typedef std::pair<std::string, FrameCreateFunc> Pair;
|
typedef std::pair<std::string, FrameCreateFunc> Pair;
|
||||||
|
|
||||||
std::unordered_map<std::string, FrameCreateFunc> _funcs;
|
std::unordered_map<std::string, FrameCreateFunc> _funcs;
|
||||||
cocos2d::Map<std::string, TimelineAction*> _animationActions;
|
cocos2d::Map<std::string, cocos2d::TimelineAction*> _animationActions;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,10 +42,7 @@
|
||||||
<ClCompile Include="..\CCTween.cpp" />
|
<ClCompile Include="..\CCTween.cpp" />
|
||||||
<ClCompile Include="..\CCUtilMath.cpp" />
|
<ClCompile Include="..\CCUtilMath.cpp" />
|
||||||
<ClCompile Include="..\DictionaryHelper.cpp" />
|
<ClCompile Include="..\DictionaryHelper.cpp" />
|
||||||
<ClCompile Include="..\TimelineAction\CCFrame.cpp" />
|
|
||||||
<ClCompile Include="..\TimelineAction\CCNodeReader.cpp" />
|
<ClCompile Include="..\TimelineAction\CCNodeReader.cpp" />
|
||||||
<ClCompile Include="..\TimelineAction\CCTimeLine.cpp" />
|
|
||||||
<ClCompile Include="..\TimelineAction\CCTimelineAction.cpp" />
|
|
||||||
<ClCompile Include="..\TimelineAction\CCTimelineActionCache.cpp" />
|
<ClCompile Include="..\TimelineAction\CCTimelineActionCache.cpp" />
|
||||||
<ClCompile Include="..\TriggerBase.cpp" />
|
<ClCompile Include="..\TriggerBase.cpp" />
|
||||||
<ClCompile Include="..\TriggerMng.cpp" />
|
<ClCompile Include="..\TriggerMng.cpp" />
|
||||||
|
@ -108,10 +105,7 @@
|
||||||
<ClInclude Include="..\CCTween.h" />
|
<ClInclude Include="..\CCTween.h" />
|
||||||
<ClInclude Include="..\CCUtilMath.h" />
|
<ClInclude Include="..\CCUtilMath.h" />
|
||||||
<ClInclude Include="..\DictionaryHelper.h" />
|
<ClInclude Include="..\DictionaryHelper.h" />
|
||||||
<ClInclude Include="..\TimelineAction\CCFrame.h" />
|
|
||||||
<ClInclude Include="..\TimelineAction\CCNodeReader.h" />
|
<ClInclude Include="..\TimelineAction\CCNodeReader.h" />
|
||||||
<ClInclude Include="..\TimelineAction\CCTimeLine.h" />
|
|
||||||
<ClInclude Include="..\TimelineAction\CCTimelineAction.h" />
|
|
||||||
<ClInclude Include="..\TimelineAction\CCTimelineActionCache.h" />
|
<ClInclude Include="..\TimelineAction\CCTimelineActionCache.h" />
|
||||||
<ClInclude Include="..\TriggerBase.h" />
|
<ClInclude Include="..\TriggerBase.h" />
|
||||||
<ClInclude Include="..\TriggerMng.h" />
|
<ClInclude Include="..\TriggerMng.h" />
|
||||||
|
|
|
@ -231,15 +231,6 @@
|
||||||
<ClCompile Include="..\WidgetReader\PageViewReader\PageViewReader.cpp">
|
<ClCompile Include="..\WidgetReader\PageViewReader\PageViewReader.cpp">
|
||||||
<Filter>reader\WidgetReader\PageViewReader</Filter>
|
<Filter>reader\WidgetReader\PageViewReader</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\TimelineAction\CCFrame.cpp">
|
|
||||||
<Filter>TimelineAction</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\TimelineAction\CCTimeLine.cpp">
|
|
||||||
<Filter>TimelineAction</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\TimelineAction\CCTimelineAction.cpp">
|
|
||||||
<Filter>TimelineAction</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\TimelineAction\CCTimelineActionCache.cpp">
|
<ClCompile Include="..\TimelineAction\CCTimelineActionCache.cpp">
|
||||||
<Filter>TimelineAction</Filter>
|
<Filter>TimelineAction</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -428,15 +419,6 @@
|
||||||
<ClInclude Include="..\WidgetReader\PageViewReader\PageViewReader.h">
|
<ClInclude Include="..\WidgetReader\PageViewReader\PageViewReader.h">
|
||||||
<Filter>reader\WidgetReader\PageViewReader</Filter>
|
<Filter>reader\WidgetReader\PageViewReader</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\TimelineAction\CCFrame.h">
|
|
||||||
<Filter>TimelineAction</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\TimelineAction\CCTimeLine.h">
|
|
||||||
<Filter>TimelineAction</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\TimelineAction\CCTimelineAction.h">
|
|
||||||
<Filter>TimelineAction</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\TimelineAction\CCTimelineActionCache.h">
|
<ClInclude Include="..\TimelineAction\CCTimelineActionCache.h">
|
||||||
<Filter>TimelineAction</Filter>
|
<Filter>TimelineAction</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
|
Loading…
Reference in New Issue