cocos2d-x  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AnimationFrame Class Reference

AnimationFrame. More...

#include <CCAnimation.h>

Inheritance diagram for AnimationFrame:
Ref Clonable

Classes

struct  DisplayedEventInfo
 When the animation display,Dispatches the event of UserData. More...
 

Public Member Functions

SpriteFramegetSpriteFrame () const
 Return a SpriteFrameName to be used. More...
 
var getSpriteFrame ()
 Return a SpriteFrameName to be used. More...
 
local getSpriteFrame ()
 Return a SpriteFrameName to be used. More...
 
void setSpriteFrame (SpriteFrame *frame)
 Set the SpriteFrame. More...
 
var setSpriteFrame ( var frame)
 Set the SpriteFrame. More...
 
local setSpriteFrame ( local frame)
 Set the SpriteFrame. More...
 
float getDelayUnits () const
 Gets the units of time the frame takes. More...
 
var getDelayUnits ()
 Gets the units of time the frame takes. More...
 
local getDelayUnits ()
 Gets the units of time the frame takes. More...
 
void setDelayUnits (float delayUnits)
 Sets the units of time the frame takes. More...
 
var setDelayUnits ( var delayUnits)
 Sets the units of time the frame takes. More...
 
local setDelayUnits ( local delayUnits)
 Sets the units of time the frame takes. More...
 
const ValueMapgetUserInfo () const
 Gets user infomation A AnimationFrameDisplayedNotification notification will be broadcast when the frame is displayed with this dictionary as UserInfo. More...
 
ValueMapgetUserInfo ()
var getUserInfo ()
local getUserInfo ()
void setUserInfo (const ValueMap &userInfo)
 Sets user infomation. More...
 
var setUserInfo ( var userInfo)
 Sets user infomation. More...
 
local setUserInfo ( local userInfo)
 Sets user infomation. More...
 
virtual AnimationFrameclone () const override
 Returns a copy of the Ref. More...
 
virtual ~AnimationFrame ()
bool initWithSpriteFrame (SpriteFrame *spriteFrame, float delayUnits, const ValueMap &userInfo)
 initializes the animation frame with a spriteframe, number of delay units and a notification user info More...
 
var initWithSpriteFrame ( var spriteFrame, var delayUnits, var userInfo)
 initializes the animation frame with a spriteframe, number of delay units and a notification user info More...
 
local initWithSpriteFrame ( local spriteFrame, local delayUnits, local userInfo)
 initializes the animation frame with a spriteframe, number of delay units and a notification user info More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor. More...
 
- Public Member Functions inherited from Clonable
virtual ~Clonable ()
Refcopy () const
 Returns a copy of the Ref. More...
 

Static Public Member Functions

static AnimationFramecreate (SpriteFrame *spriteFrame, float delayUnits, const ValueMap &userInfo)
 Creates the animation frame with a spriteframe, number of delay units and a notification user info. More...
 
local create ( local spriteFrame, local delayUnits, local userInfo)
 Creates the animation frame with a spriteframe, number of delay units and a notification user info. More...
 

Public Attributes

CC_CONSTRUCTOR_ACCESS __pad0__: AnimationFrame()

Protected Attributes

SpriteFrame_spriteFrame
 SpriteFrameName to be used. More...
 
float _delayUnits
 how many units of time the frame takes More...
 
var _delayUnits
 how many units of time the frame takes More...
 
local _delayUnits
 how many units of time the frame takes More...
 
ValueMap _userInfo
 A AnimationFrameDisplayedNotification notification will be broadcast when the frame is displayed with this dictionary as UserInfo. More...
 
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 
local _referenceCount
 count of references More...
 

Additional Inherited Members

- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 
 Ref ()
 Constructor. More...
 

Detailed Description

AnimationFrame.

A frame of the animation. It contains information like:

  • sprite frame name.

# of delay units.

  • offset
Since
v2.0

Constructor & Destructor Documentation

virtual ~AnimationFrame ( )
virtual

Member Function Documentation

virtual AnimationFrame* clone ( ) const
overridevirtual

Returns a copy of the Ref.

Implements Clonable.

var clone ( )
overridevirtual

Returns a copy of the Ref.

Implements Clonable.

local clone ( )
overridevirtual

Returns a copy of the Ref.

Implements Clonable.

static AnimationFrame* create ( SpriteFrame spriteFrame,
float  delayUnits,
const ValueMap userInfo 
)
static

Creates the animation frame with a spriteframe, number of delay units and a notification user info.

Parameters
spriteFrameThe animation frame with a spriteframe.
delayUnitsNumber of delay units.
userInfoA notification user info.
Since
3.0
var create ( var  spriteFrame,
var  delayUnits,
var  userInfo 
)
static

Creates the animation frame with a spriteframe, number of delay units and a notification user info.

Parameters
spriteFrameThe animation frame with a spriteframe.
delayUnitsNumber of delay units.
userInfoA notification user info.
Since
3.0
local create ( local  spriteFrame,
local  delayUnits,
local  userInfo 
)
static

Creates the animation frame with a spriteframe, number of delay units and a notification user info.

Parameters
spriteFrameThe animation frame with a spriteframe.
delayUnitsNumber of delay units.
userInfoA notification user info.
Since
3.0
float getDelayUnits ( ) const
inline

Gets the units of time the frame takes.

Returns
The units of time the frame takes.
var getDelayUnits ( )
inline

Gets the units of time the frame takes.

Returns
The units of time the frame takes.
local getDelayUnits ( )
inline

Gets the units of time the frame takes.

Returns
The units of time the frame takes.
SpriteFrame* getSpriteFrame ( ) const
inline

Return a SpriteFrameName to be used.

Returns
a SpriteFrameName to be used.
var getSpriteFrame ( )
inline

Return a SpriteFrameName to be used.

Returns
a SpriteFrameName to be used.
local getSpriteFrame ( )
inline

Return a SpriteFrameName to be used.

Returns
a SpriteFrameName to be used.
const ValueMap& getUserInfo ( ) const
inline

Gets user infomation A AnimationFrameDisplayedNotification notification will be broadcast when the frame is displayed with this dictionary as UserInfo.

If UserInfo is nil, then no notification will be broadcast.

Returns
A dictionary as UserInfo
var getUserInfo ( )
inline

Gets user infomation A AnimationFrameDisplayedNotification notification will be broadcast when the frame is displayed with this dictionary as UserInfo.

If UserInfo is nil, then no notification will be broadcast.

Returns
A dictionary as UserInfo
local getUserInfo ( )
inline

Gets user infomation A AnimationFrameDisplayedNotification notification will be broadcast when the frame is displayed with this dictionary as UserInfo.

If UserInfo is nil, then no notification will be broadcast.

Returns
A dictionary as UserInfo
ValueMap& getUserInfo ( )
inline
var getUserInfo ( )
inline
local getUserInfo ( )
inline
bool initWithSpriteFrame ( SpriteFrame spriteFrame,
float  delayUnits,
const ValueMap userInfo 
)

initializes the animation frame with a spriteframe, number of delay units and a notification user info

var initWithSpriteFrame ( var  spriteFrame,
var  delayUnits,
var  userInfo 
)

initializes the animation frame with a spriteframe, number of delay units and a notification user info

local initWithSpriteFrame ( local  spriteFrame,
local  delayUnits,
local  userInfo 
)

initializes the animation frame with a spriteframe, number of delay units and a notification user info

void setDelayUnits ( float  delayUnits)
inline

Sets the units of time the frame takes.

Parameters
delayUnitsThe units of time the frame takes.
var setDelayUnits ( var  delayUnits)
inline

Sets the units of time the frame takes.

Parameters
delayUnitsThe units of time the frame takes.
local setDelayUnits ( local  delayUnits)
inline

Sets the units of time the frame takes.

Parameters
delayUnitsThe units of time the frame takes.
void setSpriteFrame ( SpriteFrame frame)
inline

Set the SpriteFrame.

Parameters
frameA SpriteFrame will be used.
var setSpriteFrame ( var  frame)
inline

Set the SpriteFrame.

Parameters
frameA SpriteFrame will be used.
local setSpriteFrame ( local  frame)
inline

Set the SpriteFrame.

Parameters
frameA SpriteFrame will be used.
void setUserInfo ( const ValueMap userInfo)
inline

Sets user infomation.

Parameters
userInfoA dictionary as UserInfo.
var setUserInfo ( var  userInfo)
inline

Sets user infomation.

Parameters
userInfoA dictionary as UserInfo.
local setUserInfo ( local  userInfo)
inline

Sets user infomation.

Parameters
userInfoA dictionary as UserInfo.

Member Data Documentation

var __pad0__
local __pad0__
float _delayUnits
protected

how many units of time the frame takes

var _delayUnits
protected

how many units of time the frame takes

local _delayUnits
protected

how many units of time the frame takes

SpriteFrame* _spriteFrame
protected

SpriteFrameName to be used.

var _spriteFrame
protected

SpriteFrameName to be used.

local _spriteFrame
protected

SpriteFrameName to be used.

ValueMap _userInfo
protected

A AnimationFrameDisplayedNotification notification will be broadcast when the frame is displayed with this dictionary as UserInfo.

If UserInfo is nil, then no notification will be broadcast.

var _userInfo
protected

A AnimationFrameDisplayedNotification notification will be broadcast when the frame is displayed with this dictionary as UserInfo.

If UserInfo is nil, then no notification will be broadcast.

local _userInfo
protected

A AnimationFrameDisplayedNotification notification will be broadcast when the frame is displayed with this dictionary as UserInfo.

If UserInfo is nil, then no notification will be broadcast.


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