CUGL 2.3
Cornell University Game Library
|
#include <CUScaleAction.h>
Public Member Functions | |
ScaleBy () | |
~ScaleBy () | |
void | dispose () |
bool | init () |
bool | init (const Vec2 &factor) |
bool | init (const Vec2 &factor, float time) |
const Vec2 & | getFactor () const |
void | setFactor (const Vec2 &factor) |
virtual std::shared_ptr< Action > | clone () override |
virtual void | load (const std::shared_ptr< SceneNode > &target, Uint64 *state) override |
virtual void | update (const std::shared_ptr< SceneNode > &target, Uint64 *state, float dt) override |
virtual std::string | toString (bool verbose=false) const override |
Public Member Functions inherited from cugl::scene2::Action | |
Action () | |
~Action () | |
float | getDuration () const |
void | setDuration (float time) |
virtual std::shared_ptr< Action > | clone () |
virtual void | load (const std::shared_ptr< SceneNode > &target, Uint64 *state) |
virtual void | update (const std::shared_ptr< SceneNode > &target, Uint64 *state, float dt) |
virtual std::string | toString (bool verbose=false) const |
operator std::string () const | |
Static Public Member Functions | |
static std::shared_ptr< ScaleBy > | alloc () |
static std::shared_ptr< ScaleBy > | alloc (const Vec2 &factor) |
static std::shared_ptr< ScaleBy > | alloc (const Vec2 &factor, float time) |
Protected Attributes | |
Vec2 | _delta |
Protected Attributes inherited from cugl::scene2::Action | |
float | _duration |
This action represents a scale by a given factor.
An action contains only the definition of the animation. This can include information about the transform to use or the duration of the animation. However, it does not contain any attribute of the target. Hence, an action can be reapplied to different targets.
By itself, an action does nothing. It only specifies an action that may take place. To use an action, it must be passed to the ActionManager. The manager will create an action instance and animate that instance. While an action may be reused many times, an action instance corresponds to a single animation.
|
inline |
Creates an uninitialized scaling action.
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 action instance, disposing all resources
|
inlinestatic |
Returns a newly allocated. degenerate scaling action.
The scale amount is set to (1.0, 1.0), meaning no adjustment takes place.
Returns a newly allocated, instaneous scaling animation by the given factor
When animated, this action will adjust the scale of the node so that it is multiplied by the given factor. The animation will be instantaneous.
factor | The amount to scale the target node |
|
inlinestatic |
Returns a newly allocated scaling animation by the given factor
When animated, this action will adjust the scale of the node so that it is multiplied by the given factor. The animation will take place over the given number of seconds.
factor | The amount to scale the target node |
time | The animation duration |
|
overridevirtual |
Returns a newly allocated copy of this Action.
Reimplemented from cugl::scene2::Action.
|
inline |
Disposes all of the resources used by this action.
A disposed action can be safely reinitialized.
|
inline |
Returns the scaling factor for this action.
Changing this value for an actively animating action can have undefined effects.
|
inline |
Initializes a degenerate scaling action.
The scale amount is set to (1.0, 1.0), meaning no adjustment takes place.
|
inline |
Initializes an instaneous scaling animation by the given factor
When animated, this action will adjust the scale of the node so that it is multiplied by the given factor. The animation will be instantaneous.
factor | The amount to scale the target node |
bool cugl::scene2::ScaleBy::init | ( | const Vec2 & | factor, |
float | time | ||
) |
Initializes a scaling animation by the given factor
When animated, this action will adjust the scale of the node so that it is multiplied by the given factor. The animation will take place over the given number of seconds.
factor | The amount to scale the target node |
time | The animation duration |
|
overridevirtual |
Prepares a target for action
The important state of the target is stored in the given state parameter. The semantics of this state is action-dependent.
target | The node to act on |
state | The relevant node state |
Reimplemented from cugl::scene2::Action.
|
inline |
Sets the scaling factor for this action.
Changing this value for an actively animating action can have undefined effects.
factor | the scaling factor for this action. |
|
overridevirtual |
Returns a string representation of the action for debugging purposes.
If verbose is true, the string will include class information. This allows us to unambiguously identify the class.
verbose | Whether to include class information |
Reimplemented from cugl::scene2::Action.
|
overridevirtual |
Executes an action on the given target node.
The important state of the target is stored in the given state parameter. The semantics of this state is action-dependent.
target | The node to act on |
state | The relevant node state |
dt | The elapsed time to animate. |
Reimplemented from cugl::scene2::Action.
|
protected |
The scaling factor