mirror of https://github.com/axmolengine/axmol.git
Merge pull request #11592 from fusijie/add_EaseRateAction_create_method
Add EaseRateAction::create() method.
This commit is contained in:
commit
033cfaa30b
|
@ -90,6 +90,24 @@ ActionInterval* ActionEase::getInnerAction()
|
||||||
// EaseRateAction
|
// EaseRateAction
|
||||||
//
|
//
|
||||||
|
|
||||||
|
EaseRateAction* EaseRateAction::create(ActionInterval* action, float rate)
|
||||||
|
{
|
||||||
|
EaseRateAction *easeRateAction = new (std::nothrow) EaseRateAction();
|
||||||
|
if (easeRateAction)
|
||||||
|
{
|
||||||
|
if (easeRateAction->initWithAction(action, rate))
|
||||||
|
{
|
||||||
|
easeRateAction->autorelease();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CC_SAFE_RELEASE_NULL(easeRateAction);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return easeRateAction;
|
||||||
|
}
|
||||||
|
|
||||||
bool EaseRateAction::initWithAction(ActionInterval *action, float rate)
|
bool EaseRateAction::initWithAction(ActionInterval *action, float rate)
|
||||||
{
|
{
|
||||||
if (ActionEase::initWithAction(action))
|
if (ActionEase::initWithAction(action))
|
||||||
|
|
|
@ -97,6 +97,14 @@ private:
|
||||||
class CC_DLL EaseRateAction : public ActionEase
|
class CC_DLL EaseRateAction : public ActionEase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
@brief Creates the action with the inner action and the rate parameter.
|
||||||
|
@param action A given ActionInterval
|
||||||
|
@param rate A given rate
|
||||||
|
@return An autoreleased EaseRateAction object.
|
||||||
|
**/
|
||||||
|
static EaseRateAction* create(ActionInterval* action, float rate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Set the rate value for the ease rate action.
|
@brief Set the rate value for the ease rate action.
|
||||||
@param rate The value will be set.
|
@param rate The value will be set.
|
||||||
|
|
Loading…
Reference in New Issue