2021-12-31 12:12:40 +08:00
|
|
|
/****************************************************************************
|
2019-11-23 20:27:39 +08:00
|
|
|
Copyright (c) 2013 cocos2d-x.org
|
|
|
|
|
2022-08-08 18:02:17 +08:00
|
|
|
https://axys1.github.io/
|
2019-11-23 20:27:39 +08:00
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __CCFRAME_H__
|
|
|
|
#define __CCFRAME_H__
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include "base/CCRef.h"
|
|
|
|
#include "base/CCVector.h"
|
|
|
|
#include "2d/CCNode.h"
|
|
|
|
#include "2d/CCSprite.h"
|
|
|
|
#include "2d/CCTweenFunction.h"
|
2020-10-21 10:12:00 +08:00
|
|
|
#include "ActionTimeline/CCTimelineMacro.h"
|
|
|
|
#include "CocosStudioExport.h"
|
2019-11-23 20:27:39 +08:00
|
|
|
|
|
|
|
NS_TIMELINE_BEGIN
|
|
|
|
|
|
|
|
class Timeline;
|
|
|
|
class ActionTimeline;
|
|
|
|
|
2022-08-08 18:02:17 +08:00
|
|
|
class CCS_DLL Frame : public ax::Ref
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void setFrameIndex(unsigned int frameIndex) { _frameIndex = frameIndex; }
|
|
|
|
virtual unsigned int getFrameIndex() const { return _frameIndex; }
|
|
|
|
|
|
|
|
virtual void setTimeline(Timeline* timeline) { _timeline = timeline; }
|
|
|
|
virtual Timeline* getTimeline() const { return _timeline; }
|
|
|
|
|
2022-08-08 18:02:17 +08:00
|
|
|
virtual void setNode(ax::Node* node) { _node = node; }
|
|
|
|
virtual ax::Node* getNode() const { return _node; }
|
2019-11-23 20:27:39 +08:00
|
|
|
|
|
|
|
virtual void setTween(bool tween) { _tween = tween; }
|
|
|
|
virtual bool isTween() const { return _tween; }
|
|
|
|
|
2022-08-08 18:02:17 +08:00
|
|
|
virtual void setTweenType(const ax::tweenfunc::TweenType& tweenType) { _tweenType = tweenType; }
|
|
|
|
virtual ax::tweenfunc::TweenType getTweenType() const { return _tweenType; }
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
// !to make easing with params, need setTweenType(TweenType::CUSTOM_EASING)
|
|
|
|
virtual void setEasingParams(const std::vector<float>& easingParams);
|
|
|
|
virtual const std::vector<float>& getEasingParams() const;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual bool isEnterWhenPassed() { return _enterWhenPassed; }
|
|
|
|
|
|
|
|
virtual void onEnter(Frame* nextFrame, int currentFrameIndex) = 0;
|
|
|
|
virtual void apply(float percent);
|
|
|
|
|
|
|
|
virtual Frame* clone() = 0;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
protected:
|
|
|
|
Frame();
|
|
|
|
virtual ~Frame();
|
2021-12-25 10:04:45 +08:00
|
|
|
|
|
|
|
virtual void onApply(float percent){};
|
|
|
|
// update percent depends _tweenType, and return the Calculated percent
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual float tweenPercent(float percent);
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual void emitEvent();
|
|
|
|
virtual void cloneProperty(Frame* frame);
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
protected:
|
2021-12-25 10:04:45 +08:00
|
|
|
unsigned int _frameIndex;
|
|
|
|
bool _tween;
|
|
|
|
bool _enterWhenPassed;
|
2019-11-23 20:27:39 +08:00
|
|
|
|
2022-08-08 18:02:17 +08:00
|
|
|
ax::tweenfunc::TweenType _tweenType;
|
2021-12-25 10:04:45 +08:00
|
|
|
std::vector<float> _easingParam;
|
2019-11-23 20:27:39 +08:00
|
|
|
Timeline* _timeline;
|
2022-08-08 18:02:17 +08:00
|
|
|
ax::Node* _node;
|
2019-11-23 20:27:39 +08:00
|
|
|
};
|
|
|
|
|
2020-10-17 16:32:16 +08:00
|
|
|
class CCS_DLL VisibleFrame : public Frame
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
static VisibleFrame* create();
|
|
|
|
|
|
|
|
VisibleFrame();
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual void onEnter(Frame* nextFrame, int currentFrameIndex) override;
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual Frame* clone() override;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
inline void setVisible(bool visible) { _visible = visible; }
|
2019-11-23 20:27:39 +08:00
|
|
|
inline bool isVisible() const { return _visible; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
bool _visible;
|
|
|
|
};
|
|
|
|
|
2020-10-17 16:32:16 +08:00
|
|
|
class CCS_DLL TextureFrame : public Frame
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
static TextureFrame* create();
|
|
|
|
|
|
|
|
TextureFrame();
|
|
|
|
|
2022-08-08 18:02:17 +08:00
|
|
|
virtual void setNode(ax::Node* node) override;
|
2019-11-23 20:27:39 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual void onEnter(Frame* nextFrame, int currentFrameIndex) override;
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual Frame* clone() override;
|
|
|
|
|
2021-12-31 12:12:40 +08:00
|
|
|
inline void setTextureName(std::string_view textureName) { _textureName = textureName; }
|
|
|
|
inline std::string_view getTextureName() const { return _textureName; }
|
2019-11-23 20:27:39 +08:00
|
|
|
|
|
|
|
protected:
|
2022-08-08 18:02:17 +08:00
|
|
|
ax::Sprite* _sprite;
|
2019-11-23 20:27:39 +08:00
|
|
|
std::string _textureName;
|
|
|
|
};
|
|
|
|
|
2020-10-17 16:32:16 +08:00
|
|
|
class CCS_DLL RotationFrame : public Frame
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
static RotationFrame* create();
|
|
|
|
|
|
|
|
RotationFrame();
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual void onEnter(Frame* nextFrame, int currentFrameIndex) override;
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual Frame* clone() override;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
inline void setRotation(float rotation) { _rotation = rotation; }
|
2019-11-23 20:27:39 +08:00
|
|
|
inline float getRotation() const { return _rotation; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void onApply(float percent) override;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
float _rotation;
|
|
|
|
float _betwennRotation;
|
|
|
|
};
|
|
|
|
|
2020-10-17 16:32:16 +08:00
|
|
|
class CCS_DLL SkewFrame : public Frame
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
static SkewFrame* create();
|
|
|
|
|
|
|
|
SkewFrame();
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual void onEnter(Frame* nextFrame, int currentFrameIndex) override;
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual Frame* clone() override;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
inline void setSkewX(float skewx) { _skewX = skewx; }
|
2019-11-23 20:27:39 +08:00
|
|
|
inline float getSkewX() const { return _skewX; }
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
inline void setSkewY(float skewy) { _skewY = skewy; }
|
2019-11-23 20:27:39 +08:00
|
|
|
inline float getSkewY() const { return _skewY; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void onApply(float percent) override;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
float _skewX;
|
|
|
|
float _skewY;
|
|
|
|
float _betweenSkewX;
|
|
|
|
float _betweenSkewY;
|
|
|
|
};
|
|
|
|
|
2020-10-17 16:32:16 +08:00
|
|
|
class CCS_DLL RotationSkewFrame : public SkewFrame
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
static RotationSkewFrame* create();
|
|
|
|
|
|
|
|
RotationSkewFrame();
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual void onEnter(Frame* nextFrame, int currentFrameIndex) override;
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual Frame* clone() override;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
protected:
|
|
|
|
virtual void onApply(float percent) override;
|
|
|
|
};
|
|
|
|
|
2020-10-17 16:32:16 +08:00
|
|
|
class CCS_DLL PositionFrame : public Frame
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
static PositionFrame* create();
|
|
|
|
|
|
|
|
PositionFrame();
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual void onEnter(Frame* nextFrame, int currentFrameIndex) override;
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual Frame* clone() override;
|
|
|
|
|
2022-08-08 18:02:17 +08:00
|
|
|
inline void setPosition(const ax::Point& position) { _position = position; }
|
|
|
|
inline ax::Point getPosition() const { return _position; }
|
2019-11-23 20:27:39 +08:00
|
|
|
|
|
|
|
inline void setX(float x) { _position.x = x; }
|
|
|
|
inline void setY(float y) { _position.y = y; }
|
|
|
|
|
|
|
|
inline float getX() const { return _position.x; }
|
|
|
|
inline float getY() const { return _position.y; }
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
protected:
|
|
|
|
virtual void onApply(float percent) override;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2022-08-08 18:02:17 +08:00
|
|
|
ax::Point _position;
|
2019-11-23 20:27:39 +08:00
|
|
|
float _betweenX;
|
|
|
|
float _betweenY;
|
|
|
|
};
|
|
|
|
|
2020-10-17 16:32:16 +08:00
|
|
|
class CCS_DLL ScaleFrame : public Frame
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
static ScaleFrame* create();
|
|
|
|
|
|
|
|
ScaleFrame();
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual void onEnter(Frame* nextFrame, int currentFrameIndex) override;
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual Frame* clone() override;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
inline void setScale(float scale)
|
|
|
|
{
|
|
|
|
_scaleX = scale;
|
|
|
|
_scaleY = scale;
|
|
|
|
}
|
2019-11-23 20:27:39 +08:00
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
inline void setScaleX(float scaleX) { _scaleX = scaleX; }
|
2019-11-23 20:27:39 +08:00
|
|
|
inline float getScaleX() const { return _scaleX; }
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
inline void setScaleY(float scaleY) { _scaleY = scaleY; }
|
2019-11-23 20:27:39 +08:00
|
|
|
inline float getScaleY() const { return _scaleY; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void onApply(float percent) override;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
float _scaleX;
|
|
|
|
float _scaleY;
|
|
|
|
float _betweenScaleX;
|
|
|
|
float _betweenScaleY;
|
|
|
|
};
|
|
|
|
|
2020-10-17 16:32:16 +08:00
|
|
|
class CCS_DLL AnchorPointFrame : public Frame
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
static AnchorPointFrame* create();
|
|
|
|
|
|
|
|
AnchorPointFrame();
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual void onEnter(Frame* nextFrame, int currentFrameIndex) override;
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual Frame* clone() override;
|
|
|
|
|
2022-08-08 18:02:17 +08:00
|
|
|
inline void setAnchorPoint(const ax::Point& point) { _anchorPoint = point; }
|
|
|
|
inline ax::Point getAnchorPoint() const { return _anchorPoint; }
|
2019-11-23 20:27:39 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void onApply(float percent) override;
|
|
|
|
|
2022-08-08 18:02:17 +08:00
|
|
|
ax::Vec2 _betweenAnchorPoint;
|
|
|
|
ax::Vec2 _anchorPoint;
|
2019-11-23 20:27:39 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
enum InnerActionType
|
|
|
|
{
|
|
|
|
LoopAction,
|
|
|
|
NoLoopAction,
|
|
|
|
SingleFrame
|
|
|
|
};
|
|
|
|
|
2020-10-17 16:32:16 +08:00
|
|
|
class CCS_DLL InnerActionFrame : public Frame
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
static const std::string AnimationAllName;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
static InnerActionFrame* create();
|
|
|
|
InnerActionFrame();
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual void onEnter(Frame* nextFrame, int currentFrameIndex) override;
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual Frame* clone() override;
|
|
|
|
|
|
|
|
inline void setInnerActionType(InnerActionType type) { _innerActionType = type; }
|
|
|
|
inline InnerActionType getInnerActionType() const { return _innerActionType; }
|
2021-12-25 10:04:45 +08:00
|
|
|
|
|
|
|
inline void setEnterWithName(bool isEnterWithName) { _enterWithName = isEnterWithName; }
|
|
|
|
|
|
|
|
void setStartFrameIndex(int frameIndex);
|
|
|
|
inline int getStartFrameIndex() const { return _startFrameIndex; }
|
|
|
|
|
|
|
|
void setEndFrameIndex(int frameIndex);
|
|
|
|
inline int getEndFrameIndex() const { return _endFrameIndex; }
|
|
|
|
|
2021-12-31 12:12:40 +08:00
|
|
|
void setAnimationName(std::string_view animationNamed);
|
2021-12-25 10:04:45 +08:00
|
|
|
|
|
|
|
inline void setSingleFrameIndex(int frameIndex) { _singleFrameIndex = frameIndex; }
|
|
|
|
inline int getSingleFrameIndex() const { return _singleFrameIndex; }
|
2019-11-23 20:27:39 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
InnerActionType _innerActionType;
|
|
|
|
int _startFrameIndex;
|
|
|
|
int _endFrameIndex;
|
|
|
|
int _singleFrameIndex;
|
|
|
|
std::string _animationName;
|
|
|
|
bool _enterWithName;
|
|
|
|
};
|
|
|
|
|
2020-10-17 16:32:16 +08:00
|
|
|
class CCS_DLL ColorFrame : public Frame
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
static ColorFrame* create();
|
|
|
|
ColorFrame();
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual void onEnter(Frame* nextFrame, int currentFrameIndex) override;
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual Frame* clone() override;
|
|
|
|
|
|
|
|
/** @deprecated Use method setAlpha() and getAlpha() of AlphaFrame instead */
|
2022-07-16 10:43:05 +08:00
|
|
|
AX_DEPRECATED_ATTRIBUTE inline void setAlpha(uint8_t alpha) { _alpha = alpha; }
|
|
|
|
AX_DEPRECATED_ATTRIBUTE inline uint8_t getAlpha() const { return _alpha; }
|
2019-11-23 20:27:39 +08:00
|
|
|
|
2022-08-08 18:02:17 +08:00
|
|
|
inline void setColor(const ax::Color3B& color) { _color = color; }
|
|
|
|
inline ax::Color3B getColor() const { return _color; }
|
2019-11-23 20:27:39 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void onApply(float percent) override;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2019-11-25 01:35:26 +08:00
|
|
|
uint8_t _alpha;
|
2022-08-08 18:02:17 +08:00
|
|
|
ax::Color3B _color;
|
2019-11-23 20:27:39 +08:00
|
|
|
|
|
|
|
int _betweenRed;
|
|
|
|
int _betweenGreen;
|
|
|
|
int _betweenBlue;
|
|
|
|
};
|
|
|
|
|
2020-10-17 16:32:16 +08:00
|
|
|
class CCS_DLL AlphaFrame : public Frame
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
static AlphaFrame* create();
|
|
|
|
AlphaFrame();
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual void onEnter(Frame* nextFrame, int currentFrameIndex) override;
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual Frame* clone() override;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
inline void setAlpha(uint8_t alpha) { _alpha = alpha; }
|
2019-11-25 01:35:26 +08:00
|
|
|
inline uint8_t getAlpha() const { return _alpha; }
|
2019-11-23 20:27:39 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void onApply(float percent) override;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2019-11-25 01:35:26 +08:00
|
|
|
uint8_t _alpha;
|
2019-11-23 20:27:39 +08:00
|
|
|
int _betweenAlpha;
|
|
|
|
};
|
|
|
|
|
2020-10-17 16:32:16 +08:00
|
|
|
class CCS_DLL EventFrame : public Frame
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
static EventFrame* create();
|
|
|
|
void init();
|
|
|
|
|
|
|
|
EventFrame();
|
|
|
|
|
2022-08-08 18:02:17 +08:00
|
|
|
virtual void setNode(ax::Node* node) override;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
|
|
|
virtual void onEnter(Frame* nextFrame, int currentFrameIndex) override;
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual Frame* clone() override;
|
|
|
|
|
2021-12-31 12:12:40 +08:00
|
|
|
inline void setEvent(std::string_view event) { _event = event; }
|
|
|
|
inline std::string_view getEvent() const { return _event; }
|
2019-11-23 20:27:39 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
std::string _event;
|
|
|
|
ActionTimeline* _action;
|
|
|
|
};
|
|
|
|
|
2020-10-17 16:32:16 +08:00
|
|
|
class CCS_DLL ZOrderFrame : public Frame
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
static ZOrderFrame* create();
|
|
|
|
|
|
|
|
ZOrderFrame();
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
virtual void onEnter(Frame* nextFrame, int currentFrameIndex) override;
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual Frame* clone() override;
|
|
|
|
|
2021-12-25 10:04:45 +08:00
|
|
|
inline void setZOrder(int zorder) { _zorder = zorder; }
|
2019-11-23 20:27:39 +08:00
|
|
|
inline int getZOrder() const { return _zorder; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
int _zorder;
|
|
|
|
};
|
|
|
|
|
2020-10-17 16:32:16 +08:00
|
|
|
class CCS_DLL BlendFuncFrame : public Frame
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
static BlendFuncFrame* create();
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
BlendFuncFrame();
|
2021-12-25 10:04:45 +08:00
|
|
|
|
|
|
|
virtual void onEnter(Frame* nextFrame, int currentFrameIndex) override;
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual Frame* clone() override;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2022-08-08 18:02:17 +08:00
|
|
|
inline ax::BlendFunc getBlendFunc() const { return _blendFunc; }
|
|
|
|
inline void setBlendFunc(ax::BlendFunc blendFunc) { _blendFunc = blendFunc; }
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
protected:
|
2022-08-08 18:02:17 +08:00
|
|
|
ax::BlendFunc _blendFunc;
|
2019-11-23 20:27:39 +08:00
|
|
|
};
|
|
|
|
|
2020-10-17 16:32:16 +08:00
|
|
|
class CCS_DLL PlayableFrame : public Frame
|
2019-11-23 20:27:39 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
static PlayableFrame* create();
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
PlayableFrame();
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
virtual void onEnter(Frame* nextFrame, int currentFrameINdex) override;
|
|
|
|
virtual Frame* clone() override;
|
|
|
|
|
|
|
|
inline std::string getPlayableAct() const { return _playableAct; }
|
|
|
|
// @param playact, express the interface in PlayableProtocol, should be "start" or "stop"
|
|
|
|
inline void setPlayableAct(std::string playact) { _playableAct = playact; }
|
|
|
|
|
|
|
|
static const std::string PLAYABLE_EXTENTION;
|
2021-12-25 10:04:45 +08:00
|
|
|
|
2019-11-23 20:27:39 +08:00
|
|
|
private:
|
|
|
|
std::string _playableAct; // express the interface in PlayableProtocol
|
|
|
|
static const std::string START_ACT;
|
|
|
|
static const std::string STOP_ACT;
|
|
|
|
};
|
|
|
|
NS_TIMELINE_END
|
|
|
|
|
|
|
|
#endif /*__CCFRAME_H__*/
|