Merge pull request #10946 from natural-law/v3

[ci skip] Update comments of some header files.
This commit is contained in:
minggo 2015-03-18 18:25:31 +08:00
commit 359e25327d
6 changed files with 833 additions and 298 deletions

File diff suppressed because it is too large Load Diff

View File

@ -39,12 +39,19 @@ class NodeGrid;
* @{
*/
/** @brief Base class for Grid actions */
/**
@class GridAction
@brief Base class for Grid actions.
@detail Grid actions are the actions take effect on GridBase.
*/
class CC_DLL GridAction : public ActionInterval
{
public:
/** returns the grid */
/**
@brief Get the pointer of GridBase.
@return The pointer of GridBase.
*/
virtual GridBase* getGrid();
// overrides
@ -60,8 +67,10 @@ CC_CONSTRUCTOR_ACCESS:
GridAction() {}
virtual ~GridAction() {}
/**
* initializes the action with size and duration
* @param duration in seconds
* @brief Initializes the action with size and duration.
* @param duration The duration of the GridAction. It's a value in seconds.
* @param gridSize The size of the GridAction should be.
* @return Return true when the initialization success, otherwise return false.
*/
bool initWithDuration(float duration, const Size& gridSize);
@ -78,15 +87,18 @@ private:
/**
@brief Base class for Grid3D actions.
Grid3D actions can modify a non-tiled grid.
@detail Grid3D actions can modify a non-tiled grid.
*/
class CC_DLL Grid3DAction : public GridAction
{
public:
/** returns the grid */
virtual GridBase* getGrid() override;
/** returns the vertex than belongs to certain position in the grid
/**
* @brief Get the vertex that belongs to certain position in the grid.
* @param position The position of the grid.
* @return Return a pointer of vertex.
* @js NA
* @lua NA
*/
@ -98,7 +110,10 @@ public:
*/
CC_DEPRECATED_ATTRIBUTE inline Vec3 vertex(const Vec2& position) { return getVertex(position); }
/** returns the non-transformed vertex than belongs to certain position in the grid
/**
* @brief Get the non-transformed vertex that belongs to certain position in the grid.
* @param position The position of the grid.
* @return Return a pointer of vertex.
* @js NA
* @lua NA
*/
@ -110,7 +125,10 @@ public:
*/
CC_DEPRECATED_ATTRIBUTE inline Vec3 originalVertex(const Vec2& position) { return getOriginalVertex(position); }
/** sets a new vertex to a certain position of the grid
/**
* @brief Set a new vertex to a certain position of the grid.
* @param position The position of the grid.
* @param vertex The vertex will be used on the certain position of grid.
* @js NA
* @lua NA
*/
@ -124,17 +142,26 @@ public:
}
};
/** @brief Base class for TiledGrid3D actions */
/**
@brief Base class for TiledGrid3D actions
*/
class CC_DLL TiledGrid3DAction : public GridAction
{
public:
/** creates the action with size and duration
/**
* @brief Create the action with size and duration.
* @param duration The duration of the action. It's a value in seconds.
* @param gridSize Specify the grid size of the action.
* @return A pointer of TiledGrid3DAction. If creation failed, return nil.
* @js NA
* @lua NA
*/
static TiledGrid3DAction* create(float duration, const Size& gridSize);
/** returns the tile that belongs to a certain position of the grid
/**
* @brief Get the tile that belongs to a certain position of the grid.
* @param position The position of the tile want to get.
* @return A quadrilateral of the tile.
* @js NA
* @lua NA
*/
@ -146,19 +173,25 @@ public:
*/
CC_DEPRECATED_ATTRIBUTE Quad3 tile(const Vec2& position) { return getTile(position); }
/** returns the non-transformed tile that belongs to a certain position of the grid
/**
* @brief Get the non-transformed tile that belongs to a certain position of the grid.
* @param position The position of the tile want to get.
* @return A quadrilateral of the tile.
* @js NA
* @lua NA
*/
Quad3 getOriginalTile(const Vec2& position) const;
/** @deprecated Use getOriginalTile() instead
/** @deprecated Use getOriginalTile() instead.
* @js NA
* @lua NA
*/
CC_DEPRECATED_ATTRIBUTE Quad3 originalTile(const Vec2& position) { return getOriginalTile(position); }
/** sets a new tile to a certain position of the grid
/**
* @brief Set a new tile to a certain position of the grid.
* @param position The position of the tile.
* @param coords The quadrilateral of the new tile.
* @js NA
* @lua NA
*/
@ -175,23 +208,33 @@ public:
}
};
/** @brief AccelDeccelAmplitude action */
/**
@brief AccelDeccelAmplitude action.
*/
class CC_DLL AccelDeccelAmplitude : public ActionInterval
{
public:
/** creates the action with an inner action that has the amplitude property, and a duration time */
/**
@brief Create the action with an inner action that has the amplitude property, and a duration time.
@@param action A pointer of the inner action.
@param duration Specify the duration of the AccelDeccelAmplitude action.
@return Return a pointer of AccelDeccelAmplitude action. When the creation failed, return nil.
*/
static AccelDeccelAmplitude* create(Action *action, float duration);
/** get amplitude rate */
/**
@brief Get the value of amplitude rate.
@return the value of amplitude rate.
*/
inline float getRate(void) const { return _rate; }
/** set amplitude rate */
/**
@brief Set the value of amplitude rate.
@param rate Specify the value of amplitude rate.
*/
inline void setRate(float rate) { _rate = rate; }
// Overrides
virtual void startWithTarget(Node *target) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual AccelDeccelAmplitude* clone() const override;
virtual AccelDeccelAmplitude* reverse() const override;
@ -200,7 +243,12 @@ CC_CONSTRUCTOR_ACCESS:
AccelDeccelAmplitude() {}
virtual ~AccelDeccelAmplitude();
/** initializes the action with an inner action that has the amplitude property, and a duration time */
/**
@brief Initializes the action with an inner action that has the amplitude property, and a duration time.
@param action A pointer of the inner action.
@param duration Specify the duration of the AccelDeccelAmplitude action.
@return If the initialization success, return true; otherwise, return false.
*/
bool initWithAction(Action *action, float duration);
protected:
@ -211,23 +259,33 @@ private:
CC_DISALLOW_COPY_AND_ASSIGN(AccelDeccelAmplitude);
};
/** @brief AccelAmplitude action */
/**
@brief AccelAmplitude action.
*/
class CC_DLL AccelAmplitude : public ActionInterval
{
public:
/** creates the action with an inner action that has the amplitude property, and a duration time */
/**
@brief Create the action with an inner action that has the amplitude property, and a duration time.
@param action A pointer of the inner action.
@param duration Specify the duration of the AccelAmplitude action.
@return Return a pointer of AccelAmplitude action. When the creation failed, return nil.
*/
static AccelAmplitude* create(Action *action, float duration);
/** get amplitude rate */
/**
@brief Get the value of amplitude rate.
@return The value of amplitude rate.
*/
inline float getRate() const { return _rate; }
/** set amplitude rate */
/**
@brief Set the value of amplitude rate.
@param rate Specify the value of amplitude rate.
*/
inline void setRate(float rate) { _rate = rate; }
// Overrides
virtual void startWithTarget(Node *target) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual AccelAmplitude* clone() const override;
virtual AccelAmplitude* reverse() const override;
@ -246,23 +304,33 @@ private:
CC_DISALLOW_COPY_AND_ASSIGN(AccelAmplitude);
};
/** @brief DeccelAmplitude action */
/**
@brief DeccelAmplitude action
*/
class CC_DLL DeccelAmplitude : public ActionInterval
{
public:
/** creates the action with an inner action that has the amplitude property, and a duration time */
/**
@brief Creates the action with an inner action that has the amplitude property, and a duration time.
@param action A pointer of the inner action.
@param duration Specify the duration of the DeccelAmplitude action.
@return Return a pointer of DeccelAmplitude. When the creation failed, return nil.
*/
static DeccelAmplitude* create(Action *action, float duration);
/** get amplitude rate */
/**
@brief Get the value of amplitude rate.
@return The value of amplitude rate.
*/
inline float getRate() const { return _rate; }
/** set amplitude rate */
/**
@brief Set the value of amplitude rate.
@param rate Specify the value.
*/
inline void setRate(float rate) { _rate = rate; }
// overrides
virtual void startWithTarget(Node *target) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual DeccelAmplitude* clone() const override;
virtual DeccelAmplitude* reverse() const override;
@ -271,7 +339,12 @@ CC_CONSTRUCTOR_ACCESS:
DeccelAmplitude() {}
virtual ~DeccelAmplitude();
/** initializes the action with an inner action that has the amplitude property, and a duration time */
/**
@brief Initializes the action with an inner action that has the amplitude property, and a duration time.
@param action The pointer of inner action.
@param duration The duration of the DeccelAmplitude action.
@return If the initilization sucess, return true; otherwise, return false.
*/
bool initWithAction(Action *action, float duration);
protected:
@ -282,7 +355,8 @@ private:
CC_DISALLOW_COPY_AND_ASSIGN(DeccelAmplitude);
};
/** @brief StopGrid action.
/**
@brief StopGrid action.
@warning Don't call this action if another grid action is active.
Call if you want to remove the the grid effect. Example:
Sequence::actions(Lens::action(...), StopGrid::action(...), nullptr);
@ -290,7 +364,10 @@ private:
class CC_DLL StopGrid : public ActionInstant
{
public:
/** Allocates and initializes the action */
/**
@brief Create a StopGrid Action.
@return Return a pointer of StopGrid. When the creation failed, return nil.
*/
static StopGrid* create();
// Overrides
@ -311,11 +388,17 @@ private:
CC_DISALLOW_COPY_AND_ASSIGN(StopGrid);
};
/** @brief ReuseGrid action */
/**
@brief ReuseGrid action.
*/
class CC_DLL ReuseGrid : public ActionInstant
{
public:
/** creates an action with the number of times that the current grid will be reused */
/**
@brief Create an action with the number of times that the current grid will be reused.
@param times Specify times the grid will be reused.
@return Return a pointer of ReuseGrid. When the creation failed, return nil.
*/
static ReuseGrid* create(int times);
// Override
@ -327,7 +410,11 @@ CC_CONSTRUCTOR_ACCESS:
ReuseGrid() {}
virtual ~ReuseGrid() {}
/** initializes an action with the number of times that the current grid will be reused */
/**
@brief Initializes an action with the number of times that the current grid will be reused.
@param times Specify times the grid will be reused.
@return If the initialization sucess, return true; otherwise, return false.
*/
bool initWithTimes(int times);
protected:

View File

@ -36,36 +36,62 @@ NS_CC_BEGIN
*/
/**
@brief Waves3D action
@brief Waves3D action.
@detail This action is used for take effect on the target node as 3D waves.
You can control the effect by these parameters:
duration, grid size, waves count, amplitude.
*/
class CC_DLL Waves3D : public Grid3DAction
{
public:
/** creates an action with duration, grid size, waves and amplitude */
/**
@brief Create an action with duration, grid size, waves and amplitude.
@param duration Specify the duration of the Waves3D action. It's a value in seconds.
@param gridSize Specify the size of the grid.
@param waves Specify the waves count of the Waves3D action.
@param amplitude Specify the amplitude of the Waves3D action.
@return If the creation sucess, return a pointer of Waves3D action; otherwise, return nil.
*/
static Waves3D* create(float duration, const Size& gridSize, unsigned int waves, float amplitude);
/** returns the amplitude of the effect */
/**
@brief Get the amplitude of the effect.
@return Return the amplitude of the effect.
*/
inline float getAmplitude() const { return _amplitude; }
/** sets the amplitude to the effect */
/**
@brief Set the amplitude to the effect.
@param amplitude The value of amplitude will be set.
*/
inline void setAmplitude(float amplitude) { _amplitude = amplitude; }
/** returns the amplitude rate */
/**
@brief Get the amplitude rate of the effect.
@return Return the amplitude rate of the effect.
*/
inline float getAmplitudeRate() const { return _amplitudeRate; }
/** sets the ampliture rate */
/**
@brief Set the ampliture rate of the effect.
@param amplitudeRate The value of amplitude rate will be set.
*/
inline void setAmplitudeRate(float amplitudeRate) { _amplitudeRate = amplitudeRate; }
// Overrides
virtual Waves3D* clone() const override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
Waves3D() {}
virtual ~Waves3D() {}
/** initializes an action with duration, grid size, waves and amplitude */
/**
@brief Initializes an action with duration, grid size, waves and amplitude.
@param duration Specify the duration of the Waves3D action. It's a value in seconds.
@param gridSize Specify the size of the grid.
@param waves Specify the waves count of the Waves3D action.
@param amplitude Specify the amplitude of the Waves3D action.
@return If the initialization success, return true; otherwise, return false.
*/
bool initWithDuration(float duration, const Size& gridSize, unsigned int waves, float amplitude);
protected:
@ -77,43 +103,62 @@ private:
CC_DISALLOW_COPY_AND_ASSIGN(Waves3D);
};
/** @brief FlipX3D action */
/**
@brief FlipX3D action.
@detail This action is used for flipping the target node on the x axis.
*/
class CC_DLL FlipX3D : public Grid3DAction
{
public:
/** creates the action with duration */
/**
@brief Create the action with duration.
@param duration Specify the duration of the FilpX3D action. It's a value in seconds.
@return If the creation sucess, return a pointer of FilpX3D action; otherwise, return nil.
*/
static FlipX3D* create(float duration);
// Override
virtual FlipX3D* clone() const override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
FlipX3D() {}
virtual ~FlipX3D() {}
/** initializes the action with duration */
/**
@brief Initializes an action with duration.
@param duration Specify the duration of the FlipX3D action. It's a value in seconds.
@return If the initialization success, return true; otherwise, return false.
*/
bool initWithDuration(float duration);
/**
@brief Initializes an action with duration and grid size.
@param gridSize Specify the grid size of the FlipX3D action.
@param duration Specify the duration of the FlipX3D action. It's a value in seconds.
@return If the initialization success, return true; otherwise, return false.
*/
virtual bool initWithSize(const Size& gridSize, float duration);
private:
CC_DISALLOW_COPY_AND_ASSIGN(FlipX3D);
};
/** @brief FlipY3D action */
/**
@brief FlipY3D action.
@detail This action is used for flipping the target node on the y axis.
*/
class CC_DLL FlipY3D : public FlipX3D
{
public:
/** creates the action with duration */
/**
@brief Create the action with duration.
@param duration Specify the duration of the FlipY3D action. It's a value in seconds.
@return If the creation sucess, return a pointer of FlipY3D action; otherwise, return nil.
*/
static FlipY3D* create(float duration);
// Overrides
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual FlipY3D* clone() const override;
@ -124,35 +169,72 @@ private:
CC_DISALLOW_COPY_AND_ASSIGN(FlipY3D);
};
/** @brief Lens3D action */
/**
@brief Lens3D action.
@detail This action is used for take effect on the target node as lens.
You can create the action by these parameters:
duration, grid size, center position of lens, radius of lens.
Also you can change the lens effect value & whether effect is concave by the setter methods.
*/
class CC_DLL Lens3D : public Grid3DAction
{
public:
/** creates the action with center position, radius, a grid size and duration */
/**
@brief Create the action with center position, radius, a grid size and duration.
@param duration Specify the duration of the Lens3D action. It's a value in seconds.
@param gridSize Specify the size of the grid.
@param position Specify the center position of the lens.
@param radius Specify the radius of the lens.
@return If the creation sucess, return a pointer of Lens3D action; otherwise, return nil.
*/
static Lens3D* create(float duration, const Size& gridSize, const Vec2& position, float radius);
/** Get lens center position */
/**
@brief Get the value of lens effect. Default value is 0.7.
@return The value of lens effect.
*/
inline float getLensEffect() const { return _lensEffect; }
/** Set lens center position */
/**
@brief Set the value of lens effect.
@param lensEffect The value of lens effect will be set.
*/
inline void setLensEffect(float lensEffect) { _lensEffect = lensEffect; }
/** Set whether lens is concave */
/**
@brief Set whether lens is concave.
@param concave Whether lens is concave.
*/
inline void setConcave(bool concave) { _concave = concave; }
/**
@brief Get the center position of lens effect.
@return The center position of lens effect.
*/
inline const Vec2& getPosition() const { return _position; }
/**
@brief Set the center position of lens effect.
@param The center position will be set.
*/
void setPosition(const Vec2& position);
// Overrides
virtual Lens3D* clone() const override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
Lens3D() {}
virtual ~Lens3D() {}
/** initializes the action with center position, radius, a grid size and duration */
/**
@brief Initializes the action with center position, radius, grid size and duration.
@param duration Specify the duration of the Lens3D action. It's a value in seconds.
@param gridSize Specify the size of the grid.
@param position Specify the center position of the lens effect.
@param radius Specify the radius of the lens effect.
@return If the initialization success, return true; otherwise, return false.
*/
bool initWithDuration(float duration, const Size& gridSize, const Vec2& position, float radius);
protected:
@ -170,36 +252,79 @@ private:
CC_DISALLOW_COPY_AND_ASSIGN(Lens3D);
};
/** @brief Ripple3D action */
/**
@brief Ripple3D action.
@detail This action is used for take effect on the target node as ripple.
You can create the action by these parameters:
duration, grid size, center position of ripple,
radius of ripple, waves count, amplitude.
*/
class CC_DLL Ripple3D : public Grid3DAction
{
public:
/** creates the action with radius, number of waves, amplitude, a grid size and duration */
/**
@brief Create the action with center position, radius, number of waves, amplitude, a grid size and duration.
@param duration Specify the duration of the Ripple3D action. It's a value in seconds.
@param gridSize Specify the size of the grid.
@param position Specify the center position of the ripple effect.
@param radius Specify the radius of the ripple effect.
@param waves Specify the waves count of the ripple effect.
@param amplitude Specify the amplitude of the ripple effect.
@return If the creation sucess, return a pointer of Ripple3D action; otherwise, return nil.
*/
static Ripple3D* create(float duration, const Size& gridSize, const Vec2& position, float radius, unsigned int waves, float amplitude);
/** get center position */
/**
@brief Get the center position of ripple effect.
@return The center position of ripple effect.
*/
inline const Vec2& getPosition() const { return _position; }
/** set center position */
/**
@brief Set the center position of ripple effect.
@param position The center position of ripple effect will be set.
*/
void setPosition(const Vec2& position);
/**
@brief Get the amplitude of ripple effect.
@return The amplitude of ripple effect.
*/
inline float getAmplitude() const { return _amplitude; }
/**
@brief Set the amplitude of ripple effect.
@param fAmplitude The amplitude of ripple effect.
*/
inline void setAmplitude(float fAmplitude) { _amplitude = fAmplitude; }
/**
@brief Get the amplitude rate of ripple effect.
@return The amplitude rate of ripple effect.
*/
inline float getAmplitudeRate() const { return _amplitudeRate; }
/**
@brief Set the amplitude rate of ripple effect.
@param fAmplitudeRate The amplitude rate of ripple effect.
*/
inline void setAmplitudeRate(float fAmplitudeRate) { _amplitudeRate = fAmplitudeRate; }
// Override
virtual Ripple3D* clone() const override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
Ripple3D() {}
virtual ~Ripple3D() {}
/** initializes the action with radius, number of waves, amplitude, a grid size and duration */
/**
@brief Initializes the action with center position, radius, number of waves, amplitude, a grid size and duration.
@param duration Specify the duration of the Ripple3D action. It's a value in seconds.
@param gridSize Specify the size of the grid.
@param position Specify the center position of the ripple effect.
@param radius Specify the radius of the ripple effect.
@param waves Specify the waves count of the ripple effect.
@param amplitude Specify the amplitude of the ripple effect.
@return If the initialization success, return true; otherwise, return false.
*/
bool initWithDuration(float duration, const Size& gridSize, const Vec2& position, float radius, unsigned int waves, float amplitude);
protected:
@ -214,12 +339,24 @@ private:
CC_DISALLOW_COPY_AND_ASSIGN(Ripple3D);
};
/** @brief Shaky3D action */
/**
@brief Shaky3D action.
@detail This action is used for take effect on the target node as shaky.
You can create the action by these parameters:
duration, grid size, range, whether shake on the z axis.
*/
class CC_DLL Shaky3D : public Grid3DAction
{
public:
/** creates the action with a range, shake Z vertices, a grid and duration */
static Shaky3D* create(float duration, const Size& gridSize, int range, bool shakeZ);
/**
@brief Create the action with a range, shake Z vertices, a grid and duration.
@param duration Specify the duration of the Shaky3D action. It's a value in seconds.
@param gridSize Specify the size of the grid.
@param range Specify the range of the shaky effect.
@param shakeZ Specify whether shake on the z axis.
@return If the creation sucess, return a pointer of Shaky3D action; otherwise, return nil.
*/
static Shaky3D* create(float initWithDuration, const Size& gridSize, int range, bool shakeZ);
// Overrides
virtual Shaky3D* clone() const override;
@ -230,9 +367,13 @@ CC_CONSTRUCTOR_ACCESS:
virtual ~Shaky3D() {}
/**
* initializes the action with a range, shake Z vertices, a grid and duration
* @param duration in seconds
*/
@brief Initializes the action with a range, shake Z vertices, grid size and duration.
@param duration Specify the duration of the Shaky3D action. It's a value in seconds.
@param gridSize Specify the size of the grid.
@param range Specify the range of the shaky effect.
@param shakeZ Specify whether shake on the z axis.
@return If the Initialization sucess, return true; otherwise, return false.
*/
bool initWithDuration(float duration, const Size& gridSize, int range, bool shakeZ);
protected:
@ -243,31 +384,63 @@ private:
CC_DISALLOW_COPY_AND_ASSIGN(Shaky3D);
};
/** @brief Liquid action */
/**
@brief Liquid action.
@detail This action is used for take effect on the target node as liquid.
You can create the action by these parameters:
duration, grid size, waves count, amplitude of the liquid effect.
*/
class CC_DLL Liquid : public Grid3DAction
{
public:
/** creates the action with amplitude, a grid and duration */
/**
@brief Create the action with amplitude, grid size, waves count and duration.
@param duration Specify the duration of the Liquid action. It's a value in seconds.
@param gridSize Specify the size of the grid.
@param waves Specify the waves count of the Liquid action.
@param amplitude Specify the amplitude of the Liquid action.
@return If the creation sucess, return a pointer of Liquid action; otherwise, return nil.
*/
static Liquid* create(float duration, const Size& gridSize, unsigned int waves, float amplitude);
/**
@brief Get the amplitude of the effect.
@return Return the amplitude of the effect.
*/
inline float getAmplitude() const { return _amplitude; }
/**
@brief Set the amplitude to the effect.
@param amplitude The value of amplitude will be set.
*/
inline void setAmplitude(float amplitude) { _amplitude = amplitude; }
/**
@brief Get the amplitude rate of the effect.
@return Return the amplitude rate of the effect.
*/
inline float getAmplitudeRate() const { return _amplitudeRate; }
/**
@brief Set the ampliture rate of the effect.
@param amplitudeRate The value of amplitude rate will be set.
*/
inline void setAmplitudeRate(float amplitudeRate) { _amplitudeRate = amplitudeRate; }
// Overrides
virtual Liquid* clone() const override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
Liquid() {}
virtual ~Liquid() {}
/** initializes the action with amplitude, a grid and duration */
/**
@brief Initializes the action with amplitude, grid size, waves count and duration.
@param duration Specify the duration of the Liquid action. It's a value in seconds.
@param gridSize Specify the size of the grid.
@param waves Specify the waves count of the Liquid action.
@param amplitude Specify the amplitude of the Liquid action.
@return If the initialization sucess, return true; otherwise, return false.
*/
bool initWithDuration(float duration, const Size& gridSize, unsigned int waves, float amplitude);
protected:
@ -279,31 +452,68 @@ private:
CC_DISALLOW_COPY_AND_ASSIGN(Liquid);
};
/** @brief Waves action */
/**
@brief Waves action.
@detail This action is used for take effect on the target node as waves.
You can control the effect by these parameters:
duration, grid size, waves count, amplitude,
whether waves on horizontal and whether waves on vertical.
*/
class CC_DLL Waves : public Grid3DAction
{
public:
/** initializes the action with amplitude, horizontal sin, vertical sin, a grid and duration */
/**
@brief Create the action with amplitude, horizontal sin, vertical sin, grid size, waves count and duration.
@param duration Specify the duration of the Waves action. It's a value in seconds.
@param gridSize Specify the size of the grid.
@param waves Specify the waves count of the Waves action.
@param amplitude Specify the amplitude of the Waves action.
@param horizontal Specify whether waves on horizontal.
@param vertical Specify whether waves on vertical.
@return If the creation sucess, return a pointer of Waves action; otherwise, return nil.
*/
static Waves* create(float duration, const Size& gridSize, unsigned int waves, float amplitude, bool horizontal, bool vertical);
/**
@brief Get the amplitude of the effect.
@return Return the amplitude of the effect.
*/
inline float getAmplitude() const { return _amplitude; }
/**
@brief Set the amplitude to the effect.
@param amplitude The value of amplitude will be set.
*/
inline void setAmplitude(float amplitude) { _amplitude = amplitude; }
/**
@brief Get the amplitude rate of the effect.
@return Return the amplitude rate of the effect.
*/
inline float getAmplitudeRate() const { return _amplitudeRate; }
/**
@brief Set the ampliture rate of the effect.
@param amplitudeRate The value of amplitude rate will be set.
*/
inline void setAmplitudeRate(float amplitudeRate) { _amplitudeRate = amplitudeRate; }
// Overrides
virtual Waves* clone() const override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
Waves() {}
virtual ~Waves() {}
/** initializes the action with amplitude, horizontal sin, vertical sin, a grid and duration */
/**
@brief Initializes the action with amplitude, horizontal sin, vertical sin, grid size, waves count and duration.
@param duration Specify the duration of the Waves action. It's a value in seconds.
@param gridSize Specify the size of the grid.
@param waves Specify the waves count of the Waves action.
@param amplitude Specify the amplitude of the Waves action.
@param horizontal Specify whether waves on horizontal.
@param vertical Specify whether waves on vertical.
@return If the initialization sucess, return true; otherwise, return false.
*/
bool initWithDuration(float duration, const Size& gridSize, unsigned int waves, float amplitude, bool horizontal, bool vertical);
protected:
@ -317,37 +527,77 @@ private:
CC_DISALLOW_COPY_AND_ASSIGN(Waves);
};
/** @brief Twirl action */
/**
@brief Twirl action.
@detail This action is used for take effect on the target node as twirl.
You can control the effect by these parameters:
duration, grid size, center position, twirls count, amplitude.
*/
class CC_DLL Twirl : public Grid3DAction
{
public:
/** creates the action with center position, number of twirls, amplitude, a grid size and duration */
/**
@brief Create the action with center position, number of twirls, amplitude, a grid size and duration.
@param duration Specify the duration of the Twirl action. It's a value in seconds.
@param gridSize Specify the size of the grid.
@param position Specify the center position of the twirl action.
@param twirls Specify the twirls count of the Twirl action.
@param amplitude Specify the amplitude of the Twirl action.
@return If the creation sucess, return a pointer of Twirl action; otherwise, return nil.
*/
static Twirl* create(float duration, const Size& gridSize, Vec2 position, unsigned int twirls, float amplitude);
/** get twirl center */
/**
@brief Get the center position of twirl action.
@return The center position of twirl action.
*/
inline const Vec2& getPosition() const { return _position; }
/** set twirl center */
/**
@brief Set the center position of twirl action.
@param position The center position of twirl action will be set.
*/
void setPosition(const Vec2& position);
/**
@brief Get the amplitude of the effect.
@return Return the amplitude of the effect.
*/
inline float getAmplitude() const { return _amplitude; }
/**
@brief Set the amplitude to the effect.
@param amplitude The value of amplitude will be set.
*/
inline void setAmplitude(float amplitude) { _amplitude = amplitude; }
/**
@brief Get the amplitude rate of the effect.
@return Return the amplitude rate of the effect.
*/
inline float getAmplitudeRate() const { return _amplitudeRate; }
/**
@brief Set the ampliture rate of the effect.
@param amplitudeRate The value of amplitude rate will be set.
*/
inline void setAmplitudeRate(float amplitudeRate) { _amplitudeRate = amplitudeRate; }
// Overrides
virtual Twirl* clone() const override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
Twirl() {}
virtual ~Twirl() {}
/** initializes the action with center position, number of twirls, amplitude, a grid size and duration */
/**
@brief Initializes the action with center position, number of twirls, amplitude, a grid size and duration.
@param duration Specify the duration of the Twirl action. It's a value in seconds.
@param gridSize Specify the size of the grid.
@param position Specify the center position of the twirl action.
@param twirls Specify the twirls count of the Twirl action.
@param amplitude Specify the amplitude of the Twirl action.
@return If the initialization sucess, return true; otherwise, return false.
*/
bool initWithDuration(float duration, const Size& gridSize, Vec2 position, unsigned int twirls, float amplitude);
protected:

View File

@ -37,10 +37,10 @@ NS_CC_BEGIN
/**
@brief This action simulates a page turn from the bottom right hand corner of the screen.
It's not much use by itself but is used by the PageTurnTransition.
Based on an original paper by L Hong et al.
http://www.parc.com/publication/1638/turning-pages-of-3d-electronic-books.html
@detail It's not much use by itself but is used by the PageTurnTransition.
Based on an original paper by L Hong et al.
http://www.parc.com/publication/1638/turning-pages-of-3d-electronic-books.html
@since v0.8.2
*/
@ -48,14 +48,17 @@ class CC_DLL PageTurn3D : public Grid3DAction
{
public:
virtual GridBase* getGrid() override;
/** create the action */
/**
@brief Create an action with duration, grid size.
@param duration Specify the duration of the PageTurn3D action. It's a value in seconds.
@param gridSize Specify the size of the grid.
@return If the creation sucess, return a pointer of PageTurn3D action; otherwise, return nil.
*/
static PageTurn3D* create(float duration, const Size& gridSize);
// Overrides
virtual PageTurn3D* clone() const override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
};

View File

@ -36,15 +36,19 @@ NS_CC_BEGIN
*/
/**
@brief Progress to percentage
@brief Progress to percentage.
@detail This action show the target node from current percentage to the specified percentage.
You should specify the destination percentage when creating the action.
@since v0.99.1
*/
class CC_DLL ProgressTo : public ActionInterval
{
public:
/**
* Creates and initializes with a duration and a percent
* @param duration in seconds
* @brief Create and initializes with a duration and a destination percentage.
* @param duration Specify the duration of the ProgressTo action. It's a value in seconds.
* @param percent Specify the destination percentage.
* @return If the creation sucess, return a pointer of ProgressTo action; otherwise, return nil.
*/
static ProgressTo* create(float duration, float percent);
@ -54,9 +58,6 @@ public:
virtual ProgressTo* clone() const override;
virtual ProgressTo* reverse() const override;
virtual void startWithTarget(Node *target) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
@ -64,8 +65,10 @@ CC_CONSTRUCTOR_ACCESS:
virtual ~ProgressTo() {}
/**
* Initializes with a duration and a percent
* @param duration in seconds
* @brief Initializes with a duration and destination percentage.
* @param duration Specify the duration of the ProgressTo action. It's a value in seconds.
* @param percent Specify the destination percentage.
* @return If the creation sucess, return true; otherwise, return false.
*/
bool initWithDuration(float duration, float percent);
@ -78,15 +81,18 @@ private:
};
/**
@brief Progress from a percentage to another percentage
@brief Progress from a percentage to another percentage.
@since v0.99.1
*/
class CC_DLL ProgressFromTo : public ActionInterval
{
public:
/**
* Creates and initializes the action with a duration, a "from" percentage and a "to" percentage
* @param duration in seconds
* @brief Create and initializes the action with a duration, a "from" percentage and a "to" percentage.
* @param duration Specify the duration of the ProgressFromTo action. It's a value in seconds.
* @param fromPercentage Specify the source percentage.
* @param toPercentage Specify the destination percentage.
* @return If the creation sucess, return a pointer of ProgressFromTo action; otherwise, return nil.
*/
static ProgressFromTo* create(float duration, float fromPercentage, float toPercentage);
@ -96,16 +102,19 @@ public:
virtual ProgressFromTo* clone() const override;
virtual ProgressFromTo* reverse() const override;
virtual void startWithTarget(Node *target) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
ProgressFromTo() {}
virtual ~ProgressFromTo() {}
/** Initializes the action with a duration, a "from" percentage and a "to" percentage */
/**
* @brief Initializes the action with a duration, a "from" percentage and a "to" percentage.
* @param duration Specify the duration of the ProgressFromTo action. It's a value in seconds.
* @param fromPercentage Specify the source percentage.
* @param toPercentage Specify the destination percentage.
* @return If the creation sucess, return true; otherwise, return false.
*/
bool initWithDuration(float duration, float fromPercentage, float toPercentage);
protected:

View File

@ -35,6 +35,15 @@ NS_CC_BEGIN
* @{
*/
/**
@brief The delegate class for ActionTween.
@detail If you want to use ActionTween on a node.
You should implement the node follow these steps:
1. The node should be inherit from ActionTweenDelegate.
2. Override the virtual method updateTweenAction in the node.
Then once you running ActionTween on the node, the method updateTweenAction will be incoked.
*/
class CC_DLL ActionTweenDelegate
{
public:
@ -43,6 +52,12 @@ public:
* @lua NA
*/
virtual ~ActionTweenDelegate() {}
/**
@brief The callback function when ActionTween is running.
@param value The new value of the specified key.
@param key The key of property which should be updated.
*/
virtual void updateTweenAction(float value, const std::string& key) = 0;
};
@ -70,24 +85,29 @@ class CC_DLL ActionTween : public ActionInterval
{
public:
/**
* creates an initializes the action with the property name (key), and the from and to parameters.
* @param duration in seconds
* @brief Create and initializes the action with the property name (key), and the from and to parameters.
* @param duration The duration of the ActionTween. It's a value in seconds.
* @param key The key of property which should be updated.
* @param from The value of the specified property when the action begin.
* @param to The value of the specified property when the action end.
* @return If the creation success, return a pointer of ActionTween; otherwise, return nil.
*/
static ActionTween* create(float duration, const std::string& key, float from, float to);
// Overrides
void startWithTarget(Node *target) override;
/**
* @param dt in seconds
*/
void update(float dt) override;
ActionTween* reverse() const override;
ActionTween *clone() const override;
CC_CONSTRUCTOR_ACCESS:
/**
* initializes the action with the property name (key), and the from and to parameters.
* @param duration in seconds
* @brief Initializes the action with the property name (key), and the from and to parameters.
* @param duration The duration of the ActionTween. It's a value in seconds.
* @param key The key of property which should be updated.
* @param from The value of the specified property when the action begin.
* @param to The value of the specified property when the action end.
* @return If the initialization success, return true; otherwise, return false.
*/
bool initWithDuration(float duration, const std::string& key, float from, float to);