![]() |
CUGL 3.0
Cornell University Game Library
|
#include <CUTransformAction2.h>
Public Member Functions | |
MoveBy () | |
~MoveBy () | |
void | dispose () |
bool | init () |
bool | init (const Vec2 delta) |
const Vec2 & | getDelta () const |
void | setDelta (const Vec2 &delta) |
ActionFunction | attach (const std::shared_ptr< scene2::SceneNode > &node) |
Static Public Member Functions | |
static std::shared_ptr< MoveBy > | alloc () |
static std::shared_ptr< MoveBy > | alloc (const Vec2 delta) |
This factory creates an action for movement by a given vector amount.
This class is actually a factory for creating movement actions. To create an action, call attach
with the appropriate SceneNode
. Note that this class contains no duration information. That is supplied when the action is added to ActionTimeline
.
|
inline |
Creates an uninitialized movement animation.
NEVER USE A CONSTRUCTOR WITH NEW. If you want to allocate an object on the heap, use one of the static constructors instead.
|
inline |
Deletes this animation, disposing all resources
|
inlinestatic |
Returns a newly allocated degenerate movement animation.
The movement amount is set to (0.0, 0.0), meaning no movement takes place.
Returns a newly allocated movement animation over the given vector.
When animated, this associated action will move its target by the given delta.
delta | The amount to move the attached node |
ActionFunction cugl::scene2::MoveBy::attach | ( | const std::shared_ptr< scene2::SceneNode > & | node | ) |
Returns an action attaching this animation to the given scene node
This action will reference this object during the animation. Any changes to this object during that time may alter the animation.
Note that the action has no associated duration. That should be set when it is added to ActionTimeline
.
node | The node to attach |
|
inline |
Disposes all of the resources used by this animation.
A disposed animation can be safely reinitialized.
|
inline |
Returns the movement delta for this animation.
Changing this value for an actively animating action can have undefined side effects.
|
inline |
Initializes a degenerate movement animation.
The movement amount is set to (0.0, 0.0), meaning no movement takes place.
bool cugl::scene2::MoveBy::init | ( | const Vec2 | delta | ) |
Initializes a movement animation by the given vector.
When animated, this associated action will move its target by the given delta.
delta | The amount to move the attached node |
|
inline |
Sets the movement delta for this action.
Changing this value for an actively animating action can have undefined side effects.
delta | the movement delta for this action. |