Cocos2d-x  v3.10
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
AnimationFrame Class Reference

A frame of the animation. More...

Inherits Ref, and 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...
 
void setSpriteFrame (SpriteFrame *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 ValueMap & getUserInfo () const
 Gets user infomation A AnimationFrameDisplayedNotification notification will be broadcast when the frame is displayed with this dictionary as UserInfo. More...
 
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.
 
local clone ()
 Returns a copy of the Ref.
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
local 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...
 
local getReferenceCount ()
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor.
 
- Public Member Functions inherited from Clonable
Refcopy () const
 Returns a copy of the Ref.
 

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...
 

Protected Member Functions

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
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
local _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
local _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
local _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 
local _rooted
 When true, it means that the object was already rooted.
 
bool _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 
local _scriptOwned
 The life of the object is scrolled by the scripting engine. More...
 

Detailed Description

A frame of the animation.

It contains information like:

  • sprite frame name.
  • # of delay units.
  • offset

Member Function Documentation

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.

The animation frame with a spriteframe. Number of delay units. A notification user info.

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.

The animation frame with a spriteframe. Number of delay units. A notification user info.

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.

The animation frame with a spriteframe. Number of delay units. A notification user info.

SpriteFrame* getSpriteFrame ( ) const
inline

Return a SpriteFrameName to be used.

a SpriteFrameName to be used.

var getSpriteFrame ( )
inline

Return a SpriteFrameName to be used.

a SpriteFrameName to be used.

local getSpriteFrame ( )
inline

Return a SpriteFrameName to be used.

a SpriteFrameName to be used.

void setSpriteFrame ( SpriteFrame frame)
inline

Set the SpriteFrame.

A SpriteFrame will be used.

var setSpriteFrame ( var  frame)
inline

Set the SpriteFrame.

A SpriteFrame will be used.

local setSpriteFrame ( local  frame)
inline

Set the SpriteFrame.

A SpriteFrame will be used.

float getDelayUnits ( ) const
inline

Gets the units of time the frame takes.

The units of time the frame takes.

var getDelayUnits ( )
inline

Gets the units of time the frame takes.

The units of time the frame takes.

local getDelayUnits ( )
inline

Gets the units of time the frame takes.

The units of time the frame takes.

void setDelayUnits ( float  delayUnits)
inline

Sets the units of time the frame takes.

The units of time the frame takes.

var setDelayUnits ( var  delayUnits)
inline

Sets the units of time the frame takes.

The units of time the frame takes.

local setDelayUnits ( local  delayUnits)
inline

Sets the units of time the frame takes.

The units of time the frame takes.

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.

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.

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.

A dictionary as UserInfo

void setUserInfo ( const ValueMap &  userInfo)
inline

Sets user infomation.

A dictionary as UserInfo.

var setUserInfo ( var  userInfo)
inline

Sets user infomation.

A dictionary as UserInfo.

local setUserInfo ( local  userInfo)
inline

Sets user infomation.

A dictionary as UserInfo.


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