CUGL 2.1
Cornell University Game Library
|
#include <CUScaleAction.h>
Public Member Functions | |
ScaleTo () | |
~ScaleTo () | |
void | dispose () |
bool | init () |
bool | init (const Vec2 &scale) |
bool | init (const Vec2 &scale, float time) |
const Vec2 & | getScale () const |
void | setScale (const Vec2 &scale) |
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) |
operator std::string () const | |
Static Public Member Functions | |
static std::shared_ptr< ScaleTo > | alloc () |
static std::shared_ptr< ScaleTo > | alloc (const Vec2 &scale) |
static std::shared_ptr< ScaleTo > | alloc (const Vec2 &scale, float time) |
Protected Attributes | |
Vec2 | _scale |
Protected Attributes inherited from cugl::scene2::Action | |
float | _duration |
This action represents a scale towards a fixed magnification
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 scaling action returning the node to normal size
The animation will be instantaneous.
Returns a newly allocated scaling action towards the given scale amount
The animation will be instantaneous.
scale | The target scaling amount |
|
inlinestatic |
Returns a newly allocated scaling action towards the given scale amount
The animation will take place over the given number of seconds.
scale | The target scaling amount |
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 movement delta for this action.
Changing this value for an actively animating action can have undefined effects.
|
inline |
Initializes a scaling action returning the node to normal size
The animation will be instantaneous.
|
inline |
Initializes a scaling action towards the given scale amount
The animation will be instantaneous.
scale | The target scaling amount |
bool cugl::scene2::ScaleTo::init | ( | const Vec2 & | scale, |
float | time | ||
) |
Initializes a scaling action towards the given scale amount
The animation will take place over the given number of seconds.
scale | The target scaling amount |
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 movement delta for this action.
Changing this value for an actively animating action can have undefined effects.
scale | The scale amount 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 target scaling factor at the end of the animation