![]() |
CUGL 3.0
Cornell University Game Library
|
#include <CUTransformAction2.h>
Public Member Functions | |
FadeTo () | |
~FadeTo () | |
void | dispose () |
bool | initOut () |
bool | initIn () |
bool | init (float target) |
ActionFunction | attach (const std::shared_ptr< scene2::SceneNode > &node) |
Static Public Member Functions | |
static std::shared_ptr< FadeTo > | allocOut () |
static std::shared_ptr< FadeTo > | allocIn () |
static std::shared_ptr< FadeTo > | alloc (float target) |
This factory creates a fade-in/out animation towards a specific opacity.
When applied to a node, this action will adjust the alpha value of the node color until it reaches the target value (which should be between 0 and 1). Unless the node is set for its children to inherit is color, this will have no affect on the children of the node.
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 fade-in/out 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 fade animation towards a target opacity
When applied to a node, this action will adjust the alpha value of the node color until it is eventually the target value (which should be between 0 and 1). Unless the node is set for its children to inherit its color, this will have no affect on the children of the node.
target | The target opacity |
|
inlinestatic |
Returns a newly allocated fade animation towards total opacity
When applied to a node, this action will adjust the alpha value of the node color until it is eventually 1. Unless the node is set for its children to inherit its color, this will have no affect on the children of the node.
|
inlinestatic |
Returns a newly allocated fade animation towards total transparency
When applied to a node, this action will adjust the alpha value of the node color until it is eventually 0. Unless the node is set for its children to inherit its color, this will have no affect on the children of the node.
ActionFunction cugl::scene2::FadeTo::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 action can be safely reinitialized.
bool cugl::scene2::FadeTo::init | ( | float | target | ) |
Initializes a fade animation towards a target opacity
When applied to a node, this action will adjust the alpha value of the node color until it is eventually the target value (which should be between 0 and 1). Unless the node is set for its children to inherit its color, this will have no affect on the children of the node.
target | The target opacity |
|
inline |
Initializes a fade animation towards total opacity
When applied to a node, this action will adjust the alpha value of the node color until it is eventually 1. Unless the node is set for its children to inherit its color, this will have no affect on the children of the node.
|
inline |
Initializes a fade animation towards total transparency
When applied to a node, this action will adjust the alpha value of the node color until it is eventually 0. Unless the node is set for its children to inherit its color, this will have no affect on the children of the node.