⚠️ This documentation corresponds to the latest development branch of axmol. It might diverge from the official releases.

Axmol Engine 3.0.0-dff292a
Loading...
Searching...
No Matches
TargetedAction Class Reference

Overrides the target of an action so that it always runs on the target specified at action creation rather than the one specified by runAction. More...

#include <ActionInterval.h>

Inherits ActionInterval.

Public Member Functions

void setForcedTarget (Node *forcedTarget)
 Sets the target that the action will be forced to run with.
NodegetForcedTarget ()
 returns the target that the action is forced to run with.
void update (float time) override
bool initWithTarget (Node *target, FiniteTimeAction *action)
 Init an action with the specified action and forced target.
Public Member Functions inherited from ActionInterval
float getElapsed ()
 How many seconds had elapsed since the actions started to run.
void setAmplitudeRate (float amp)
 Sets the amplitude rate, extension in GridAction.
float getAmplitudeRate ()
 Gets the amplitude rate, extension in GridAction.
void step (float dt) override
bool initWithDuration (float d)
 initializes the action

Static Public Member Functions

static TargetedActioncreate (Node *target, FiniteTimeAction *action)
 Create an action with the specified action and forced target.

Detailed Description

Overrides the target of an action so that it always runs on the target specified at action creation rather than the one specified by runAction.

Member Function Documentation

◆ create()

TargetedAction * create ( Node * target,
FiniteTimeAction * action )
static

Create an action with the specified action and forced target.

Parameters
targetThe target needs to override.
actionThe action needs to override.
Returns
An autoreleased TargetedAction object.

◆ setForcedTarget()

void setForcedTarget ( Node * forcedTarget)

Sets the target that the action will be forced to run with.

Parameters
forcedTargetThe target that the action will be forced to run with.

◆ getForcedTarget()

Node * getForcedTarget ( )
inline

returns the target that the action is forced to run with.

Returns
The target that the action is forced to run with.

◆ update()

void update ( float time)
override
Parameters
timeIn seconds.

The documentation for this class was generated from the following file:
  • ActionInterval.h