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

#include <CUAction.h>

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

Public Member Functions

 Action ()
 
 ~Action ()
 
virtual void start (float t)
 
virtual void stop (float t)
 
virtual void set (float t)
 

Detailed Description

This is a base class for definining animation actions.

For the most part,the type ActionFunction is sufficient for representing actions. However, for users that need the action to hold intermediate state, it may be easier to represent the action as an object. That is the purpose of this class.

To create an animation using this class, subclass it and implement the three methods start, stop, and set. These correspond to the three ActionState values that an action can be in.

All actions occur during a normalized time [0,1]. However, for the purposes of easing, these methods should be able to support values outside of that range.

Constructor & Destructor Documentation

◆ Action()

cugl::Action::Action ( )
inline

Creates an uninitialized action.

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

◆ ~Action()

cugl::Action::~Action ( )
inline

Deletes this action, disposing all resources

Member Function Documentation

◆ set()

virtual void cugl::Action::set ( float  t)
inlinevirtual

Sets the time of this action to t.

All actions occur during a normalized time [0,1]. However, for the purposes of easing, this method should be able to support values outside of that range.

Parameters
tThe current time of this action

◆ start()

virtual void cugl::Action::start ( float  t)
inlinevirtual

Prepares a target for action

This method should initialize any state necessary for the animation action. The value t represents the (normalized) start time of the action, which is typically 0.

Parameters
tThe start time

◆ stop()

virtual void cugl::Action::stop ( float  t)
inlinevirtual

Cleans up a target after an action

This method clearn any state that was used in the animation action. The value t represents the (normalized) completion time of the action, which is typically 1.

Parameters
tThe completion time

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