cocos2d-x  2.2.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CCDirector Class Referenceabstract

Class that creates and handle the main Window and manages how and when to execute the Scenes. More...

#include <CCDirector.h>

Inheritance diagram for CCDirector:
CCObject TypeInfo CCCopying CCDisplayLinkDirector

Public Member Functions

 CCDirector (void)
 ctor ()
virtual ~CCDirector (void)
virtual bool init (void)
var init ()
local init ()
virtual long getClassTypeInfo ()
CCScenegetRunningScene (void)
 Get current running Scene. More...
 
var getRunningScene ()
 Get current running Scene. More...
 
local getRunningScene ()
 Get current running Scene. More...
 
double getAnimationInterval (void)
 Get the FPS value. More...
 
local getAnimationInterval ()
 Get the FPS value. More...
 
virtual void setAnimationInterval (double dValue)=0
 Set the FPS value. More...
 
local setAnimationInterval ( local dValue)
 Set the FPS value. More...
 
bool isDisplayStats (void)
 Whether or not to display the FPS on the bottom-left corner. More...
 
var isDisplayStats ()
 Whether or not to display the FPS on the bottom-left corner. More...
 
local isDisplayStats ()
 Whether or not to display the FPS on the bottom-left corner. More...
 
void setDisplayStats (bool bDisplayStats)
 Display the FPS on the bottom-left corner. More...
 
var setDisplayStats ( var bDisplayStats)
 Display the FPS on the bottom-left corner. More...
 
local setDisplayStats ( local bDisplayStats)
 Display the FPS on the bottom-left corner. More...
 
float getSecondsPerFrame ()
 seconds per frame More...
 
var getSecondsPerFrame ()
 seconds per frame More...
 
local getSecondsPerFrame ()
 seconds per frame More...
 
CCEGLViewgetOpenGLView (void)
 Get the CCEGLView, where everything is rendered. More...
 
local getOpenGLView ()
 Get the CCEGLView, where everything is rendered. More...
 
void setOpenGLView (CCEGLView *pobOpenGLView)
var setOpenGLView ( var pobOpenGLView)
local setOpenGLView ( local pobOpenGLView)
bool isNextDeltaTimeZero (void)
var isNextDeltaTimeZero ()
local isNextDeltaTimeZero ()
void setNextDeltaTimeZero (bool bNextDeltaTimeZero)
var setNextDeltaTimeZero ( var bNextDeltaTimeZero)
local setNextDeltaTimeZero ( local bNextDeltaTimeZero)
bool isPaused (void)
 Whether or not the Director is paused. More...
 
var isPaused ()
 Whether or not the Director is paused. More...
 
local isPaused ()
 Whether or not the Director is paused. More...
 
unsigned int getTotalFrames (void)
 How many frames were called since the director started. More...
 
local getTotalFrames ()
 How many frames were called since the director started. More...
 
ccDirectorProjection getProjection (void)
 Sets an OpenGL projection. More...
 
local getProjection ()
 Sets an OpenGL projection. More...
 
void setProjection (ccDirectorProjection kProjection)
var setProjection ( var kProjection)
local setProjection ( local kProjection)
void reshapeProjection (const CCSize &newWindowSize)
 reshape projection matrix when canvas has been change" More...
 
var reshapeProjection ( var newWindowSize)
 reshape projection matrix when canvas has been change" More...
 
local reshapeProjection ( local newWindowSize)
 reshape projection matrix when canvas has been change" More...
 
void setViewport ()
 Sets the glViewport. More...
 
var setViewport ()
 Sets the glViewport. More...
 
local setViewport ()
 Sets the glViewport. More...
 
bool isSendCleanupToScene (void)
 How many frames were called since the director started. More...
 
CCNodegetNotificationNode ()
 This object will be visited after the main scene is visited. More...
 
var getNotificationNode ()
 This object will be visited after the main scene is visited. More...
 
local getNotificationNode ()
 This object will be visited after the main scene is visited. More...
 
void setNotificationNode (CCNode *node)
CCDirectorDelegategetDelegate () const
 CCDirector delegate. More...
 
var getDelegate ()
 CCDirector delegate. More...
 
local getDelegate ()
 CCDirector delegate. More...
 
void setDelegate (CCDirectorDelegate *pDelegate)
CCSize getWinSize (void)
 returns the size of the OpenGL view in points. More...
 
CCSize getWinSizeInPixels (void)
 returns the size of the OpenGL view in pixels. More...
 
local getWinSizeInPixels ()
 returns the size of the OpenGL view in pixels. More...
 
CCSize getVisibleSize ()
 returns visible size of the OpenGL view in points. More...
 
CCPoint getVisibleOrigin ()
 returns visible origin of the OpenGL view in points. More...
 
local getVisibleOrigin ()
 returns visible origin of the OpenGL view in points. More...
 
CCPoint convertToGL (const CCPoint &obPoint)
 converts a UIKit coordinate to an OpenGL coordinate Useful to convert (multi) touch coordinates to the current layout (portrait or landscape) More...
 
var convertToGL ( var obPoint)
 converts a UIKit coordinate to an OpenGL coordinate Useful to convert (multi) touch coordinates to the current layout (portrait or landscape) More...
 
local convertToGL ( local obPoint)
 converts a UIKit coordinate to an OpenGL coordinate Useful to convert (multi) touch coordinates to the current layout (portrait or landscape) More...
 
CCPoint convertToUI (const CCPoint &obPoint)
 converts an OpenGL coordinate to a UIKit coordinate Useful to convert node points to window points for calls such as glScissor More...
 
local convertToUI ( local obPoint)
 converts an OpenGL coordinate to a UIKit coordinate Useful to convert node points to window points for calls such as glScissor More...
 
float getZEye (void)
 XXX: missing description. More...
 
var getZEye ()
 XXX: missing description. More...
 
local getZEye ()
 XXX: missing description. More...
 
void runWithScene (CCScene *pScene)
 Enters the Director's main loop with the given Scene. More...
 
local runWithScene ( local pScene)
 Enters the Director's main loop with the given Scene. More...
 
void pushScene (CCScene *pScene)
 Suspends the execution of the running scene, pushing it on the stack of suspended scenes. More...
 
void popScene (void)
 Pops out a scene from the queue. More...
 
var popScene ()
 Pops out a scene from the queue. More...
 
local popScene ()
 Pops out a scene from the queue. More...
 
void popToRootScene (void)
 Pops out all scenes from the queue until the root scene in the queue. More...
 
var popToRootScene ()
 Pops out all scenes from the queue until the root scene in the queue. More...
 
local popToRootScene ()
 Pops out all scenes from the queue until the root scene in the queue. More...
 
void popToSceneStackLevel (int level)
 Pops out all scenes from the queue until it reaches level. More...
 
void replaceScene (CCScene *pScene)
 Replaces the running scene with a new one. More...
 
void end (void)
 Ends the execution, releases the running scene. More...
 
void pause (void)
 Pauses the running scene. More...
 
var pause ()
 Pauses the running scene. More...
 
void resume (void)
 Resumes the paused scene The scheduled timers will be activated again. More...
 
virtual void stopAnimation (void)=0
 Stops the animation. More...
 
var stopAnimation ()
 Stops the animation. More...
 
local stopAnimation ()
 Stops the animation. More...
 
virtual void startAnimation (void)=0
 The main loop is triggered again. More...
 
var startAnimation ()
 The main loop is triggered again. More...
 
local startAnimation ()
 The main loop is triggered again. More...
 
void drawScene (void)
 Draw the scene. More...
 
local drawScene ()
 Draw the scene. More...
 
void purgeCachedData (void)
 Removes cached all cocos2d cached data. More...
 
void setDefaultValues (void)
 sets the default values based on the CCConfiguration info More...
 
void setGLDefaultValues (void)
 sets the OpenGL default values More...
 
var setGLDefaultValues ()
 sets the OpenGL default values More...
 
local setGLDefaultValues ()
 sets the OpenGL default values More...
 
void setAlphaBlending (bool bOn)
 enables/disables OpenGL alpha blending More...
 
var setAlphaBlending ( var bOn)
 enables/disables OpenGL alpha blending More...
 
local setAlphaBlending ( local bOn)
 enables/disables OpenGL alpha blending More...
 
void setDepthTest (bool bOn)
 enables/disables OpenGL depth test More...
 
var setDepthTest ( var bOn)
 enables/disables OpenGL depth test More...
 
local setDepthTest ( local bOn)
 enables/disables OpenGL depth test More...
 
virtual void mainLoop (void)=0
var mainLoop ()
local mainLoop ()
void setContentScaleFactor (float scaleFactor)
 The size in pixels of the surface. More...
 
float getContentScaleFactor (void)
virtual CCSchedulergetScheduler (void)
 getScheduler More...
 
var getScheduler ()
 getScheduler More...
 
local getScheduler ()
 getScheduler More...
 
virtual void setScheduler (CCScheduler *var)
 setScheduler More...
 
local setScheduler ( local var)
 setScheduler More...
 
virtual CCActionManagergetActionManager (void)
 getActionManager More...
 
var getActionManager ()
 getActionManager More...
 
local getActionManager ()
 getActionManager More...
 
virtual void setActionManager (CCActionManager *var)
 setActionManager More...
 
local setActionManager ( local var)
 setActionManager More...
 
virtual CCTouchDispatchergetTouchDispatcher (void)
 getTouchDispatcher More...
 
local getTouchDispatcher ()
 getTouchDispatcher More...
 
virtual void setTouchDispatcher (CCTouchDispatcher *var)
 setTouchDispatcher More...
 
local setTouchDispatcher ( local var)
 setTouchDispatcher More...
 
virtual CCKeypadDispatchergetKeypadDispatcher (void)
 getKeypadDispatcher More...
 
local getKeypadDispatcher ()
 getKeypadDispatcher More...
 
virtual void setKeypadDispatcher (CCKeypadDispatcher *var)
 setKeypadDispatcher More...
 
var setKeypadDispatcher ( var var)
 setKeypadDispatcher More...
 
local setKeypadDispatcher ( local var)
 setKeypadDispatcher More...
 
virtual CCAccelerometergetAccelerometer (void)
virtual void setAccelerometer (CCAccelerometer *var)
 setAccelerometer More...
 
local setAccelerometer ( local var)
 setAccelerometer More...
 
virtual float getDeltaTime (void)
 getDeltaTime More...
 
var getDeltaTime ()
 getDeltaTime More...
 
local getDeltaTime ()
 getDeltaTime More...
 
- Public Member Functions inherited from CCObject
 CCObject (void)
virtual ~CCObject (void)
void release (void)
void retain (void)
CCObjectautorelease (void)
CCObjectcopy (void)
bool isSingleReference (void) const
unsigned int retainCount (void) const
virtual bool isEqual (const CCObject *pObject)
virtual void acceptVisitor (CCDataVisitor &visitor)
virtual void update (float dt)
- Public Member Functions inherited from CCCopying
virtual CCObjectcopyWithZone (CCZone *pZone)

Static Public Member Functions

static CCDirectorsharedDirector (void)
 returns a shared instance of the director More...
 

Protected Member Functions

void purgeDirector ()
void setNextScene (void)
local setNextScene ()
void showStats ()
var showStats ()
local showStats ()
void createStatsLabel ()
var createStatsLabel ()
local createStatsLabel ()
void calculateMPF ()
var calculateMPF ()
local calculateMPF ()
void getFPSImageData (unsigned char **datapointer, unsigned int *length)
var getFPSImageData ( var datapointer, var length)
local getFPSImageData ( local datapointer, local length)
void calculateDeltaTime ()
 calculates delta time since last time it was called More...
 

Protected Attributes

CCSchedulerm_pScheduler
 CCScheduler associated with this director. More...
 
CCActionManagerm_pActionManager
 CCActionManager associated with this director. More...
 
var m_pActionManager
 CCActionManager associated with this director. More...
 
local m_pActionManager
 CCActionManager associated with this director. More...
 
CCTouchDispatcherm_pTouchDispatcher
 CCTouchDispatcher associated with this director. More...
 
var m_pTouchDispatcher
 CCTouchDispatcher associated with this director. More...
 
local m_pTouchDispatcher
 CCTouchDispatcher associated with this director. More...
 
CCKeypadDispatcherm_pKeypadDispatcher
 CCKeypadDispatcher associated with this director. More...
 
var m_pKeypadDispatcher
 CCKeypadDispatcher associated with this director. More...
 
local m_pKeypadDispatcher
 CCKeypadDispatcher associated with this director. More...
 
CCAccelerometerm_pAccelerometer
 CCAccelerometer associated with this director. More...
 
var m_pAccelerometer
 CCAccelerometer associated with this director. More...
 
local m_pAccelerometer
 CCAccelerometer associated with this director. More...
 
float m_fDeltaTime
var m_fDeltaTime
local m_fDeltaTime
bool m_bPurgeDirecotorInNextLoop
CCEGLViewm_pobOpenGLView
double m_dAnimationInterval
var m_dAnimationInterval
local m_dAnimationInterval
double m_dOldAnimationInterval
var m_dOldAnimationInterval
local m_dOldAnimationInterval
bool m_bLandscape
var m_bLandscape
local m_bLandscape
bool m_bDisplayStats
var m_bDisplayStats
local m_bDisplayStats
float m_fAccumDt
var m_fAccumDt
local m_fAccumDt
float m_fFrameRate
var m_fFrameRate
local m_fFrameRate
CCLabelAtlasm_pFPSLabel
var m_pFPSLabel
local m_pFPSLabel
CCLabelAtlasm_pSPFLabel
var m_pSPFLabel
local m_pSPFLabel
CCLabelAtlasm_pDrawsLabel
var m_pDrawsLabel
local m_pDrawsLabel
bool m_bPaused
 Whether or not the Director is paused. More...
 
var m_bPaused
 Whether or not the Director is paused. More...
 
local m_bPaused
 Whether or not the Director is paused. More...
 
unsigned int m_uTotalFrames
var m_uTotalFrames
local m_uTotalFrames
unsigned int m_uFrames
var m_uFrames
local m_uFrames
float m_fSecondsPerFrame
var m_fSecondsPerFrame
local m_fSecondsPerFrame
CCScenem_pRunningScene
var m_pRunningScene
local m_pRunningScene
CCScenem_pNextScene
var m_pNextScene
local m_pNextScene
bool m_bSendCleanupToScene
var m_bSendCleanupToScene
local m_bSendCleanupToScene
CCArraym_pobScenesStack
var m_pobScenesStack
local m_pobScenesStack
struct cc_timevalm_pLastUpdate
var m_pLastUpdate
local m_pLastUpdate
bool m_bNextDeltaTimeZero
var m_bNextDeltaTimeZero
local m_bNextDeltaTimeZero
ccDirectorProjection m_eProjection
var m_eProjection
local m_eProjection
CCSize m_obWinSizeInPoints
var m_obWinSizeInPoints
local m_obWinSizeInPoints
float m_fContentScaleFactor
var m_fContentScaleFactor
local m_fContentScaleFactor
char * m_pszFPS
var m_pszFPS
local m_pszFPS
CCNodem_pNotificationNode
var m_pNotificationNode
local m_pNotificationNode
CCDirectorDelegatem_pProjectionDelegate
var m_pProjectionDelegate
local m_pProjectionDelegate
- Protected Attributes inherited from CCObject
unsigned int m_uReference
unsigned int m_uAutoReleaseCount

Friends

class CCEGLViewProtocol

Additional Inherited Members

- Public Attributes inherited from CCObject
unsigned int m_uID
int m_nLuaID

Detailed Description

Class that creates and handle the main Window and manages how and when to execute the Scenes.

The CCDirector is also responsible for:

  • initializing the OpenGL context
  • setting the OpenGL pixel format (default on is RGB565)
  • setting the OpenGL buffer depth (default one is 0-bit)
  • setting the projection (default one is 3D)
  • setting the orientation (default one is Portrait)

Since the CCDirector is a singleton, the standard way to use it is by calling: _ CCDirector::sharedDirector()->methodName();

The CCDirector also sets the default OpenGL context:

  • GL_TEXTURE_2D is enabled
  • GL_VERTEX_ARRAY is enabled
  • GL_COLOR_ARRAY is enabled
  • GL_TEXTURE_COORD_ARRAY is enabled

Constructor & Destructor Documentation

CCDirector ( void  )
var ctor (   )
virtual ~CCDirector ( void  )
virtual

Member Function Documentation

void calculateDeltaTime ( )
protected

calculates delta time since last time it was called

var calculateDeltaTime ( )
protected

calculates delta time since last time it was called

local calculateDeltaTime ( )
protected

calculates delta time since last time it was called

void calculateMPF ( )
protected
var calculateMPF ( )
protected
local calculateMPF ( )
protected
CCPoint convertToGL ( const CCPoint obPoint)

converts a UIKit coordinate to an OpenGL coordinate Useful to convert (multi) touch coordinates to the current layout (portrait or landscape)

var convertToGL ( var  obPoint)

converts a UIKit coordinate to an OpenGL coordinate Useful to convert (multi) touch coordinates to the current layout (portrait or landscape)

local convertToGL ( local  obPoint)

converts a UIKit coordinate to an OpenGL coordinate Useful to convert (multi) touch coordinates to the current layout (portrait or landscape)

CCPoint convertToUI ( const CCPoint obPoint)

converts an OpenGL coordinate to a UIKit coordinate Useful to convert node points to window points for calls such as glScissor

var convertToUI ( var  obPoint)

converts an OpenGL coordinate to a UIKit coordinate Useful to convert node points to window points for calls such as glScissor

local convertToUI ( local  obPoint)

converts an OpenGL coordinate to a UIKit coordinate Useful to convert node points to window points for calls such as glScissor

void createStatsLabel ( )
protected
var createStatsLabel ( )
protected
local createStatsLabel ( )
protected
void drawScene ( void  )

Draw the scene.

This method is called every frame. Don't call it manually.

var drawScene (   )

Draw the scene.

This method is called every frame. Don't call it manually.

local drawScene (   )

Draw the scene.

This method is called every frame. Don't call it manually.

void end ( void  )

Ends the execution, releases the running scene.

It doesn't remove the OpenGL view from its parent. You have to do it manually.

var end (   )

Ends the execution, releases the running scene.

It doesn't remove the OpenGL view from its parent. You have to do it manually.

local end (   )

Ends the execution, releases the running scene.

It doesn't remove the OpenGL view from its parent. You have to do it manually.

virtual CCAccelerometer*
getAccelerometer
( void  )
virtual
virtual CCActionManager*
getActionManager
( void  )
virtual

getActionManager

var getActionManager (   )
virtual

getActionManager

local getActionManager (   )
virtual

getActionManager

double getAnimationInterval ( void  )
inline

Get the FPS value.

var getAnimationInterval (   )
inline

Get the FPS value.

local getAnimationInterval (   )
inline

Get the FPS value.

virtual long getClassTypeInfo ( )
inlinevirtual

Implements TypeInfo.

float getContentScaleFactor ( void  )
var getContentScaleFactor (   )
local getContentScaleFactor (   )
CCDirectorDelegate* getDelegate ( ) const

CCDirector delegate.

It shall implemente the CCDirectorDelegate protocol

Since
v0.99.5
var getDelegate ( )

CCDirector delegate.

It shall implemente the CCDirectorDelegate protocol

Since
v0.99.5
local getDelegate ( )

CCDirector delegate.

It shall implemente the CCDirectorDelegate protocol

Since
v0.99.5
virtual float getDeltaTime ( void  )
virtual

getDeltaTime

var getDeltaTime (   )
virtual

getDeltaTime

local getDeltaTime (   )
virtual

getDeltaTime

void getFPSImageData ( unsigned char **  datapointer,
unsigned int *  length 
)
protected
var getFPSImageData ( var  datapointer,
var  length 
)
protected
local getFPSImageData ( local  datapointer,
local  length 
)
protected
virtual CCKeypadDispatcher*
getKeypadDispatcher
( void  )
virtual

getKeypadDispatcher

var getKeypadDispatcher (   )
virtual

getKeypadDispatcher

local getKeypadDispatcher (   )
virtual

getKeypadDispatcher

CCNode* getNotificationNode ( )

This object will be visited after the main scene is visited.

This object MUST implement the "visit" selector. Useful to hook a notification object, like CCNotifications (http://github.com/manucorporat/CCNotifications)

Since
v0.99.5
var getNotificationNode ( )

This object will be visited after the main scene is visited.

This object MUST implement the "visit" selector. Useful to hook a notification object, like CCNotifications (http://github.com/manucorporat/CCNotifications)

Since
v0.99.5
local getNotificationNode ( )

This object will be visited after the main scene is visited.

This object MUST implement the "visit" selector. Useful to hook a notification object, like CCNotifications (http://github.com/manucorporat/CCNotifications)

Since
v0.99.5
CCEGLView* getOpenGLView ( void  )
inline

Get the CCEGLView, where everything is rendered.

local getOpenGLView (   )
inline

Get the CCEGLView, where everything is rendered.

ccDirectorProjection getProjection ( void  )
inline

Sets an OpenGL projection.

Since
v0.8.2
local getProjection (   )
inline

Sets an OpenGL projection.

Since
v0.8.2
CCScene* getRunningScene ( void  )
inline

Get current running Scene.

Director can only run one Scene at the time

var getRunningScene (   )
inline

Get current running Scene.

Director can only run one Scene at the time

local getRunningScene (   )
inline

Get current running Scene.

Director can only run one Scene at the time

virtual CCScheduler* getScheduler ( void  )
virtual

getScheduler

var getScheduler (   )
virtual

getScheduler

local getScheduler (   )
virtual

getScheduler

float getSecondsPerFrame ( )
inline

seconds per frame

var getSecondsPerFrame ( )
inline

seconds per frame

local getSecondsPerFrame ( )
inline

seconds per frame

unsigned int getTotalFrames ( void  )
inline

How many frames were called since the director started.

var getTotalFrames (   )
inline

How many frames were called since the director started.

local getTotalFrames (   )
inline

How many frames were called since the director started.

virtual CCTouchDispatcher*
getTouchDispatcher
( void  )
virtual

getTouchDispatcher

var getTouchDispatcher (   )
virtual

getTouchDispatcher

local getTouchDispatcher (   )
virtual

getTouchDispatcher

CCPoint getVisibleOrigin ( )

returns visible origin of the OpenGL view in points.

var getVisibleOrigin ( )

returns visible origin of the OpenGL view in points.

local getVisibleOrigin ( )

returns visible origin of the OpenGL view in points.

CCSize getVisibleSize ( )

returns visible size of the OpenGL view in points.

the value is equal to getWinSize if don't invoke CCEGLView::setDesignResolutionSize()

var getVisibleSize ( )

returns visible size of the OpenGL view in points.

the value is equal to getWinSize if don't invoke CCEGLView::setDesignResolutionSize()

local getVisibleSize ( )

returns visible size of the OpenGL view in points.

the value is equal to getWinSize if don't invoke CCEGLView::setDesignResolutionSize()

CCSize getWinSize ( void  )

returns the size of the OpenGL view in points.

var getWinSize (   )

returns the size of the OpenGL view in points.

local getWinSize (   )

returns the size of the OpenGL view in points.

CCSize getWinSizeInPixels ( void  )

returns the size of the OpenGL view in pixels.

var getWinSizeInPixels (   )

returns the size of the OpenGL view in pixels.

local getWinSizeInPixels (   )

returns the size of the OpenGL view in pixels.

float getZEye ( void  )

XXX: missing description.

var getZEye (   )

XXX: missing description.

local getZEye (   )

XXX: missing description.

virtual bool init ( void  )
virtual
var init (   )
virtual
local init (   )
virtual
bool isDisplayStats ( void  )
inline

Whether or not to display the FPS on the bottom-left corner.

var isDisplayStats (   )
inline

Whether or not to display the FPS on the bottom-left corner.

local isDisplayStats (   )
inline

Whether or not to display the FPS on the bottom-left corner.

bool isNextDeltaTimeZero ( void  )
inline
var isNextDeltaTimeZero (   )
inline
local isNextDeltaTimeZero (   )
inline
bool isPaused ( void  )
inline

Whether or not the Director is paused.

var isPaused (   )
inline

Whether or not the Director is paused.

local isPaused (   )
inline

Whether or not the Director is paused.

bool isSendCleanupToScene ( void  )
inline

How many frames were called since the director started.

Whether or not the replaced scene will receive the cleanup message. If the new scene is pushed, then the old scene won't receive the "cleanup" message. If the new scene replaces the old one, the it will receive the "cleanup" message.

Since
v0.99.0
var isSendCleanupToScene (   )
inline

How many frames were called since the director started.

Whether or not the replaced scene will receive the cleanup message. If the new scene is pushed, then the old scene won't receive the "cleanup" message. If the new scene replaces the old one, the it will receive the "cleanup" message.

Since
v0.99.0
local isSendCleanupToScene (   )
inline

How many frames were called since the director started.

Whether or not the replaced scene will receive the cleanup message. If the new scene is pushed, then the old scene won't receive the "cleanup" message. If the new scene replaces the old one, the it will receive the "cleanup" message.

Since
v0.99.0
virtual void mainLoop ( void  )
pure virtual

Implemented in CCDisplayLinkDirector.

var mainLoop (   )
pure virtual

Implemented in CCDisplayLinkDirector.

local mainLoop (   )
pure virtual

Implemented in CCDisplayLinkDirector.

void pause ( void  )

Pauses the running scene.

The running scene will be drawed but all scheduled timers will be paused While paused, the draw rate will be 4 FPS to reduce CPU consumption

var pause (   )

Pauses the running scene.

The running scene will be drawed but all scheduled timers will be paused While paused, the draw rate will be 4 FPS to reduce CPU consumption

local pause (   )

Pauses the running scene.

The running scene will be drawed but all scheduled timers will be paused While paused, the draw rate will be 4 FPS to reduce CPU consumption

void popScene ( void  )

Pops out a scene from the queue.

This scene will replace the running one. The running scene will be deleted. If there are no more scenes in the stack the execution is terminated. ONLY call it if there is a running scene.

var popScene (   )

Pops out a scene from the queue.

This scene will replace the running one. The running scene will be deleted. If there are no more scenes in the stack the execution is terminated. ONLY call it if there is a running scene.

local popScene (   )

Pops out a scene from the queue.

This scene will replace the running one. The running scene will be deleted. If there are no more scenes in the stack the execution is terminated. ONLY call it if there is a running scene.

void popToRootScene ( void  )

Pops out all scenes from the queue until the root scene in the queue.

This scene will replace the running one. Internally it will call popToSceneStackLevel(1)

var popToRootScene (   )

Pops out all scenes from the queue until the root scene in the queue.

This scene will replace the running one. Internally it will call popToSceneStackLevel(1)

local popToRootScene (   )

Pops out all scenes from the queue until the root scene in the queue.

This scene will replace the running one. Internally it will call popToSceneStackLevel(1)

void popToSceneStackLevel ( int  level)

Pops out all scenes from the queue until it reaches level.

If level is 0, it will end the director. If level is 1, it will pop all scenes until it reaches to root scene. If level is <= than the current stack level, it won't do anything.

var popToSceneStackLevel ( var  level)

Pops out all scenes from the queue until it reaches level.

If level is 0, it will end the director. If level is 1, it will pop all scenes until it reaches to root scene. If level is <= than the current stack level, it won't do anything.

local popToSceneStackLevel ( local  level)

Pops out all scenes from the queue until it reaches level.

If level is 0, it will end the director. If level is 1, it will pop all scenes until it reaches to root scene. If level is <= than the current stack level, it won't do anything.

void purgeCachedData ( void  )

Removes cached all cocos2d cached data.

It will purge the CCTextureCache, CCSpriteFrameCache, CCLabelBMFont cache

Since
v0.99.3
var purgeCachedData (   )

Removes cached all cocos2d cached data.

It will purge the CCTextureCache, CCSpriteFrameCache, CCLabelBMFont cache

Since
v0.99.3
local purgeCachedData (   )

Removes cached all cocos2d cached data.

It will purge the CCTextureCache, CCSpriteFrameCache, CCLabelBMFont cache

Since
v0.99.3
void purgeDirector ( )
protected
var purgeDirector ( )
protected
local purgeDirector ( )
protected
void pushScene ( CCScene pScene)

Suspends the execution of the running scene, pushing it on the stack of suspended scenes.

The new scene will be executed. Try to avoid big stacks of pushed scenes to reduce memory allocation. ONLY call it if there is a running scene.

var pushScene ( var  pScene)

Suspends the execution of the running scene, pushing it on the stack of suspended scenes.

The new scene will be executed. Try to avoid big stacks of pushed scenes to reduce memory allocation. ONLY call it if there is a running scene.

local pushScene ( local  pScene)

Suspends the execution of the running scene, pushing it on the stack of suspended scenes.

The new scene will be executed. Try to avoid big stacks of pushed scenes to reduce memory allocation. ONLY call it if there is a running scene.

void replaceScene ( CCScene pScene)

Replaces the running scene with a new one.

The running scene is terminated. ONLY call it if there is a running scene.

var replaceScene ( var  pScene)

Replaces the running scene with a new one.

The running scene is terminated. ONLY call it if there is a running scene.

local replaceScene ( local  pScene)

Replaces the running scene with a new one.

The running scene is terminated. ONLY call it if there is a running scene.

void reshapeProjection ( const CCSize newWindowSize)

reshape projection matrix when canvas has been change"

var reshapeProjection ( var  newWindowSize)

reshape projection matrix when canvas has been change"

local reshapeProjection ( local  newWindowSize)

reshape projection matrix when canvas has been change"

void resume ( void  )

Resumes the paused scene The scheduled timers will be activated again.

The "delta time" will be 0 (as if the game wasn't paused)

var resume (   )

Resumes the paused scene The scheduled timers will be activated again.

The "delta time" will be 0 (as if the game wasn't paused)

local resume (   )

Resumes the paused scene The scheduled timers will be activated again.

The "delta time" will be 0 (as if the game wasn't paused)

void runWithScene ( CCScene pScene)

Enters the Director's main loop with the given Scene.

Call it to run only your FIRST scene. Don't call it if there is already a running scene.

It will call pushScene: and then it will call startAnimation

var runWithScene ( var  pScene)

Enters the Director's main loop with the given Scene.

Call it to run only your FIRST scene. Don't call it if there is already a running scene.

It will call pushScene: and then it will call startAnimation

local runWithScene ( local  pScene)

Enters the Director's main loop with the given Scene.

Call it to run only your FIRST scene. Don't call it if there is already a running scene.

It will call pushScene: and then it will call startAnimation

virtual void setAccelerometer ( CCAccelerometer var)
virtual

setAccelerometer

var setAccelerometer ( var  var)
virtual

setAccelerometer

local setAccelerometer ( local  var)
virtual

setAccelerometer

virtual void setActionManager ( CCActionManager var)
virtual

setActionManager

var setActionManager ( var  var)
virtual

setActionManager

local setActionManager ( local  var)
virtual

setActionManager

void setAlphaBlending ( bool  bOn)

enables/disables OpenGL alpha blending

var setAlphaBlending ( var  bOn)

enables/disables OpenGL alpha blending

local setAlphaBlending ( local  bOn)

enables/disables OpenGL alpha blending

virtual void setAnimationInterval ( double  dValue)
pure virtual

Set the FPS value.

Implemented in CCDisplayLinkDirector.

var setAnimationInterval ( var  dValue)
pure virtual

Set the FPS value.

Implemented in CCDisplayLinkDirector.

local setAnimationInterval ( local  dValue)
pure virtual

Set the FPS value.

Implemented in CCDisplayLinkDirector.

void setContentScaleFactor ( float  scaleFactor)

The size in pixels of the surface.

It could be different than the screen size. High-res devices might have a higher surface size than the screen size. Only available when compiled using SDK >= 4.0.

Since
v0.99.4
var setContentScaleFactor ( var  scaleFactor)

The size in pixels of the surface.

It could be different than the screen size. High-res devices might have a higher surface size than the screen size. Only available when compiled using SDK >= 4.0.

Since
v0.99.4
local setContentScaleFactor ( local  scaleFactor)

The size in pixels of the surface.

It could be different than the screen size. High-res devices might have a higher surface size than the screen size. Only available when compiled using SDK >= 4.0.

Since
v0.99.4
void setDefaultValues ( void  )

sets the default values based on the CCConfiguration info

var setDefaultValues (   )

sets the default values based on the CCConfiguration info

local setDefaultValues (   )

sets the default values based on the CCConfiguration info

void setDelegate ( CCDirectorDelegate pDelegate)
var setDelegate ( var  pDelegate)
local setDelegate ( local  pDelegate)
void setDepthTest ( bool  bOn)

enables/disables OpenGL depth test

var setDepthTest ( var  bOn)

enables/disables OpenGL depth test

local setDepthTest ( local  bOn)

enables/disables OpenGL depth test

void setDisplayStats ( bool  bDisplayStats)
inline

Display the FPS on the bottom-left corner.

var setDisplayStats ( var  bDisplayStats)
inline

Display the FPS on the bottom-left corner.

local setDisplayStats ( local  bDisplayStats)
inline

Display the FPS on the bottom-left corner.

void setGLDefaultValues ( void  )

sets the OpenGL default values

var setGLDefaultValues (   )

sets the OpenGL default values

local setGLDefaultValues (   )

sets the OpenGL default values

virtual void setKeypadDispatcher ( CCKeypadDispatcher var)
virtual

setKeypadDispatcher

var setKeypadDispatcher ( var  var)
virtual

setKeypadDispatcher

local setKeypadDispatcher ( local  var)
virtual

setKeypadDispatcher

void setNextDeltaTimeZero ( bool  bNextDeltaTimeZero)
var setNextDeltaTimeZero ( var  bNextDeltaTimeZero)
local setNextDeltaTimeZero ( local  bNextDeltaTimeZero)
void setNextScene ( void  )
protected
var setNextScene (   )
protected
local setNextScene (   )
protected
void setNotificationNode ( CCNode node)
var setNotificationNode ( var  node)
local setNotificationNode ( local  node)
void setOpenGLView ( CCEGLView pobOpenGLView)
var setOpenGLView ( var  pobOpenGLView)
local setOpenGLView ( local  pobOpenGLView)
void setProjection ( ccDirectorProjection  kProjection)
var setProjection ( var  kProjection)
local setProjection ( local  kProjection)
virtual void setScheduler ( CCScheduler var)
virtual

setScheduler

var setScheduler ( var  var)
virtual

setScheduler

local setScheduler ( local  var)
virtual

setScheduler

virtual void setTouchDispatcher ( CCTouchDispatcher var)
virtual

setTouchDispatcher

var setTouchDispatcher ( var  var)
virtual

setTouchDispatcher

local setTouchDispatcher ( local  var)
virtual

setTouchDispatcher

void setViewport ( )

Sets the glViewport.

var setViewport ( )

Sets the glViewport.

local setViewport ( )

Sets the glViewport.

static CCDirector* sharedDirector ( void  )
static

returns a shared instance of the director

var getInstance (   )
static

returns a shared instance of the director

local sharedDirector (   )
static

returns a shared instance of the director

void showStats ( )
protected
var showStats ( )
protected
local showStats ( )
protected
virtual void startAnimation ( void  )
pure virtual

The main loop is triggered again.

Call this function only if [stopAnimation] was called earlier

Warning
Don't call this function to start the main loop. To run the main loop call runWithScene

Implemented in CCDisplayLinkDirector.

var startAnimation (   )
pure virtual

The main loop is triggered again.

Call this function only if [stopAnimation] was called earlier

Warning
Don't call this function to start the main loop. To run the main loop call runWithScene

Implemented in CCDisplayLinkDirector.

local startAnimation (   )
pure virtual

The main loop is triggered again.

Call this function only if [stopAnimation] was called earlier

Warning
Don't call this function to start the main loop. To run the main loop call runWithScene

Implemented in CCDisplayLinkDirector.

virtual void stopAnimation ( void  )
pure virtual

Stops the animation.

Nothing will be drawn. The main loop won't be triggered anymore. If you don't want to pause your animation call [pause] instead.

Implemented in CCDisplayLinkDirector.

var stopAnimation (   )
pure virtual

Stops the animation.

Nothing will be drawn. The main loop won't be triggered anymore. If you don't want to pause your animation call [pause] instead.

Implemented in CCDisplayLinkDirector.

local stopAnimation (   )
pure virtual

Stops the animation.

Nothing will be drawn. The main loop won't be triggered anymore. If you don't want to pause your animation call [pause] instead.

Implemented in CCDisplayLinkDirector.

Friends And Related Function Documentation

friend class CCEGLViewProtocol
friend
var CCEGLViewProtocol
friend
local CCEGLViewProtocol
friend

Member Data Documentation

bool m_bDisplayStats
protected
var m_bDisplayStats
protected
local m_bDisplayStats
protected
bool m_bLandscape
protected
var m_bLandscape
protected
local m_bLandscape
protected
bool m_bNextDeltaTimeZero
protected
var m_bNextDeltaTimeZero
protected
local m_bNextDeltaTimeZero
protected
bool m_bPaused
protected

Whether or not the Director is paused.

var m_bPaused
protected

Whether or not the Director is paused.

local m_bPaused
protected

Whether or not the Director is paused.

bool m_bPurgeDirecotorInNextLoop
protected
var m_bPurgeDirecotorInNextLoop
protected
local m_bPurgeDirecotorInNextLoop
protected
bool m_bSendCleanupToScene
protected
var m_bSendCleanupToScene
protected
local m_bSendCleanupToScene
protected
double m_dAnimationInterval
protected
var m_dAnimationInterval
protected
local m_dAnimationInterval
protected
double m_dOldAnimationInterval
protected
var m_dOldAnimationInterval
protected
local m_dOldAnimationInterval
protected
ccDirectorProjection m_eProjection
protected
var m_eProjection
protected
local m_eProjection
protected
float m_fAccumDt
protected
var m_fAccumDt
protected
local m_fAccumDt
protected
float m_fContentScaleFactor
protected
var m_fContentScaleFactor
protected
local m_fContentScaleFactor
protected
float m_fDeltaTime
protected
var m_fDeltaTime
protected
local m_fDeltaTime
protected
float m_fFrameRate
protected
var m_fFrameRate
protected
local m_fFrameRate
protected
float m_fSecondsPerFrame
protected
var m_fSecondsPerFrame
protected
local m_fSecondsPerFrame
protected
CCSize m_obWinSizeInPoints
protected
var m_obWinSizeInPoints
protected
local m_obWinSizeInPoints
protected
CCAccelerometer* m_pAccelerometer
protected

CCAccelerometer associated with this director.

Since
v2.0
var m_pAccelerometer
protected

CCAccelerometer associated with this director.

Since
v2.0
local m_pAccelerometer
protected

CCAccelerometer associated with this director.

Since
v2.0
CCActionManager* m_pActionManager
protected

CCActionManager associated with this director.

Since
v2.0
var m_pActionManager
protected

CCActionManager associated with this director.

Since
v2.0
local m_pActionManager
protected

CCActionManager associated with this director.

Since
v2.0
CCLabelAtlas* m_pDrawsLabel
protected
var m_pDrawsLabel
protected
local m_pDrawsLabel
protected
CCLabelAtlas* m_pFPSLabel
protected
var m_pFPSLabel
protected
local m_pFPSLabel
protected
CCKeypadDispatcher*
m_pKeypadDispatcher
protected

CCKeypadDispatcher associated with this director.

Since
v2.0
var m_pKeypadDispatcher
protected

CCKeypadDispatcher associated with this director.

Since
v2.0
local m_pKeypadDispatcher
protected

CCKeypadDispatcher associated with this director.

Since
v2.0
struct cc_timeval* m_pLastUpdate
protected
var m_pLastUpdate
protected
local m_pLastUpdate
protected
CCScene* m_pNextScene
protected
var m_pNextScene
protected
local m_pNextScene
protected
CCNode* m_pNotificationNode
protected
var m_pNotificationNode
protected
local m_pNotificationNode
protected
CCEGLView* m_pobOpenGLView
protected
var m_pobOpenGLView
protected
local m_pobOpenGLView
protected
CCArray* m_pobScenesStack
protected
var m_pobScenesStack
protected
local m_pobScenesStack
protected
CCDirectorDelegate*
m_pProjectionDelegate
protected
var m_pProjectionDelegate
protected
local m_pProjectionDelegate
protected
CCScene* m_pRunningScene
protected
var m_pRunningScene
protected
local m_pRunningScene
protected
CCScheduler* m_pScheduler
protected

CCScheduler associated with this director.

Since
v2.0
var m_pScheduler
protected

CCScheduler associated with this director.

Since
v2.0
local m_pScheduler
protected

CCScheduler associated with this director.

Since
v2.0
CCLabelAtlas* m_pSPFLabel
protected
var m_pSPFLabel
protected
local m_pSPFLabel
protected
char* m_pszFPS
protected
var m_pszFPS
protected
local m_pszFPS
protected
CCTouchDispatcher*
m_pTouchDispatcher
protected

CCTouchDispatcher associated with this director.

Since
v2.0
var m_pTouchDispatcher
protected

CCTouchDispatcher associated with this director.

Since
v2.0
local m_pTouchDispatcher
protected

CCTouchDispatcher associated with this director.

Since
v2.0
unsigned int m_uFrames
protected
var m_uFrames
protected
local m_uFrames
protected
unsigned int m_uTotalFrames
protected
var m_uTotalFrames
protected
local m_uTotalFrames
protected

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