CUGL 3.0
Cornell University Game Library
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
cugl::scene2::ScaleBy Class Reference

#include <CUTransformAction2.h>

Inheritance diagram for cugl::scene2::ScaleBy:
cugl::Action

Public Member Functions

 ScaleBy ()
 
 ~ScaleBy ()
 
void dispose ()
 
bool init ()
 
bool init (const float factor)
 
bool init (const Vec2 factor)
 
const Vec2getFactor () const
 
void setFactor (const Vec2 factor)
 
ActionFunction attach (const std::shared_ptr< scene2::SceneNode > &node)
 
- Public Member Functions inherited from cugl::Action
 Action ()
 
 ~Action ()
 
virtual void start (float t)
 
virtual void stop (float t)
 
virtual void set (float t)
 

Static Public Member Functions

static std::shared_ptr< ScaleByalloc ()
 
static std::shared_ptr< ScaleByalloc (float factor)
 
static std::shared_ptr< ScaleByalloc (const Vec2 factor)
 

Detailed Description

This factory creates an action scaling by a given factor.

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.

Constructor & Destructor Documentation

◆ ScaleBy()

cugl::scene2::ScaleBy::ScaleBy ( )
inline

Creates an uninitialized scaling animation.

NEVER USE A CONSTRUCTOR WITH NEW. If you want to allocate an object on the heap, use one of the static constructors instead.

◆ ~ScaleBy()

cugl::scene2::ScaleBy::~ScaleBy ( )
inline

Deletes this animation, disposing all resources

Member Function Documentation

◆ alloc() [1/3]

static std::shared_ptr< ScaleBy > cugl::scene2::ScaleBy::alloc ( )
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 degenerate scaling action.

◆ alloc() [2/3]

static std::shared_ptr< ScaleBy > cugl::scene2::ScaleBy::alloc ( const Vec2  factor)
inlinestatic

Returns a newly allocated scaling animation for the given factor

When animated, this action will adjust the scale of the node so that it is multiplied by the given factor.

Parameters
factorThe amount to scale the target node
Returns
a newly allocated scaling animation for the given factor

◆ alloc() [3/3]

static std::shared_ptr< ScaleBy > cugl::scene2::ScaleBy::alloc ( float  factor)
inlinestatic

Returns a newly allocated scaling animation for the given factor

When animated, this action will adjust the scale of the node so that it is multiplied by the given factor.

Parameters
factorThe amount to scale the target node
Returns
a newly allocated scaling animation for the given factor

◆ attach()

ActionFunction cugl::scene2::ScaleBy::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.

Parameters
nodeThe node to attach
Returns
an action attaching this animation to the given scene node

◆ dispose()

void cugl::scene2::ScaleBy::dispose ( )
inline

Disposes all of the resources used by this animation.

A disposed animation can be safely reinitialized.

◆ getFactor()

const Vec2 & cugl::scene2::ScaleBy::getFactor ( ) const
inline

Returns the scaling factor for this action.

Changing this value for an actively animating action can have undefined effects.

Returns
the scaling factor for this action.

◆ init() [1/3]

bool cugl::scene2::ScaleBy::init ( )
inline

Initializes a degenerate scaling animation.

The scale amount is set to (1.0, 1.0), meaning no adjustment takes place.

Returns
true if initialization was successful.

◆ init() [2/3]

bool cugl::scene2::ScaleBy::init ( const float  factor)
inline

Initializes a scaling animation for the given factor

When animated, this action will adjust the scale of the node so that it is multiplied by the given factor.

Parameters
factorThe amount to scale the attached node
Returns
true if initialization was successful.

◆ init() [3/3]

bool cugl::scene2::ScaleBy::init ( const Vec2  factor)

Initializes a scaling animation for the given factor

When animated, this action will adjust the scale of the node so that it is multiplied by the given factor.

Parameters
factorThe amount to scale the attached node
Returns
true if initialization was successful.

◆ setFactor()

void cugl::scene2::ScaleBy::setFactor ( const Vec2  factor)
inline

Sets the scaling factor for this action.

Changing this value for an actively animating action can have undefined effects.

Parameters
factorthe scaling factor for this action.

The documentation for this class was generated from the following file: