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

#include <CUTransformAction2.h>

Inheritance diagram for cugl::scene2::ScaleTo:
cugl::Action

Public Member Functions

 ScaleTo ()
 
 ~ScaleTo ()
 
void dispose ()
 
bool init ()
 
bool init (float scale)
 
bool init (const Vec2 scale)
 
const Vec2getScale () const
 
void setScale (const Vec2 scale)
 
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< ScaleToalloc ()
 
static std::shared_ptr< ScaleToalloc (float scale)
 
static std::shared_ptr< ScaleToalloc (const Vec2 scale)
 

Protected Attributes

Vec2 _target
 

Detailed Description

This factor creates an action scaling towards a fixed magnification

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

◆ ScaleTo()

cugl::scene2::ScaleTo::ScaleTo ( )
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.

◆ ~ScaleTo()

cugl::scene2::ScaleTo::~ScaleTo ( )
inline

Deletes this animation, disposing all resources

Member Function Documentation

◆ alloc() [1/3]

static std::shared_ptr< ScaleTo > cugl::scene2::ScaleTo::alloc ( )
inlinestatic

Returns a newly allocated scaling action returning the node to normal size

Returns
a newly allocated scaling action returning the node to normal size

◆ alloc() [2/3]

static std::shared_ptr< ScaleTo > cugl::scene2::ScaleTo::alloc ( const Vec2  scale)
inlinestatic

Returns a newly allocated scaling action towards the given scale amount

Parameters
scaleThe target scaling amount
Returns
a newly allocated scaling action towards the given scale amount

◆ alloc() [3/3]

static std::shared_ptr< ScaleTo > cugl::scene2::ScaleTo::alloc ( float  scale)
inlinestatic

Returns a newly allocated scaling action towards the given scale amount

Parameters
scaleThe target scaling amount
Returns
a newly allocated scaling action towards the given scale amount

◆ attach()

ActionFunction cugl::scene2::ScaleTo::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::ScaleTo::dispose ( )
inline

Disposes all of the resources used by this animation.

A disposed animation can be safely reinitialized.

◆ getScale()

const Vec2 & cugl::scene2::ScaleTo::getScale ( ) const
inline

Returns the movement delta for this action.

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

Returns
the movement delta for this action.

◆ init() [1/3]

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

Initializes a scaling action returning the node to normal size

Returns
true if initialization was successful.

◆ init() [2/3]

bool cugl::scene2::ScaleTo::init ( const Vec2  scale)

Initializes a scaling action towards the given scale amount

Parameters
scaleThe target scaling amount
Returns
true if initialization was successful.

◆ init() [3/3]

bool cugl::scene2::ScaleTo::init ( float  scale)
inline

Initializes a scaling action towards the given scale amount

Parameters
scaleThe target scaling amount
Returns
true if initialization was successful.

◆ setScale()

void cugl::scene2::ScaleTo::setScale ( const Vec2  scale)
inline

Sets the movement delta for this action.

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

Parameters
scaleThe scale amount for this action.

Member Data Documentation

◆ _target

Vec2 cugl::scene2::ScaleTo::_target
protected

The target scaling factor at the end of the animation


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