CCDirector
CCDirector
Cocos2DClass 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.
Inheritance: System.Object
Constructors
CCDirector()
CCDirector()()
Fields
Properties
Returns true if there is more than 1 scene on the stack.
Set to true if this platform has a game pad connected.
returns a shared instance of the director
Methods
ConvertToGl(CCPoint)
Cocos2D.CCPoint ConvertToGl(CCPoint)(Cocos2D.CCPoint uiPoint)
Parameters:
uiPoint
(Cocos2D.CCPoint)Returns:
Cocos2D.CCPoint
ConvertToUi(CCPoint)
Cocos2D.CCPoint ConvertToUi(CCPoint)(Cocos2D.CCPoint glPoint)
Parameters:
glPoint
(Cocos2D.CCPoint)Returns:
Cocos2D.CCPoint
CreateStatsLabel()
CreateStatsLabel()()
DeserializeState()
System.Boolean DeserializeState()()
Returns:
System.Boolean
DrawScene(GameTime)
DrawScene(GameTime)(Microsoft.Xna.Framework.GameTime gameTime)
Draw the scene. This method is called every frame. Don't call it manually.
Parameters:
gameTime
(Microsoft.Xna.Framework.GameTime)Example
EnableTouchDispatcher()
EnableTouchDispatcher()()
End()
End()()
Init()
System.Boolean Init()()
Returns:
System.Boolean
IsSendCleanupToScene()
System.Boolean IsSendCleanupToScene()()
Returns:
System.Boolean
MainLoop(GameTime)
MainLoop(GameTime)(Microsoft.Xna.Framework.GameTime gameTime)
Parameters:
gameTime
(Microsoft.Xna.Framework.GameTime)Pause()
Pause()()
PopScene()
PopScene()()
PopScene(float, CCTransitionScene)
PopScene(float, CCTransitionScene)(System.Single t, Cocos2D.CCTransitionScene s)
Parameters:
t
(System.Single)s
(Cocos2D.CCTransitionScene)PopToRootScene()
PopToRootScene()()
Example
PopToSceneStackLevel(int)
PopToSceneStackLevel(int)(System.Int32 level)
Parameters:
level
(System.Int32)PurgeCachedData()
PurgeCachedData()()
PurgeDirector()
PurgeDirector()()
PushScene(CCScene)
PushScene(CCScene)(Cocos2D.CCScene pScene)
Push the given scene to the top of the scene stack.
Parameters:
pScene
(Cocos2D.CCScene)Example
ReplaceScene(CCScene)
ReplaceScene(CCScene)(Cocos2D.CCScene pScene)
Replaces the current scene at the top of the stack with the given scene.
Parameters:
pScene
(Cocos2D.CCScene)Example
ResetSceneStack()
ResetSceneStack()()
ResetStats()
ResetStats()()
Resume()
Resume()()
ResumeFromBackground()
ResumeFromBackground()()
RunWithScene(CCScene)
RunWithScene(CCScene)(Cocos2D.CCScene pScene)
Parameters:
pScene
(Cocos2D.CCScene)SerializeState()
SerializeState()()
Write out the current state of the director and all of its scenes.
Example
SetAlphaBlending(bool)
SetAlphaBlending(bool)(System.Boolean bOn)
enables/disables OpenGL alpha blending
Parameters:
bOn
(System.Boolean)Example
SetDefaultValues()
SetDefaultValues()()
SetDepthTest(bool)
SetDepthTest(bool)(System.Boolean bOn)
enables/disables OpenGL depth test
Parameters:
bOn
(System.Boolean)Example
SetNextDeltaTimeZero(bool)
SetNextDeltaTimeZero(bool)(System.Boolean bNextDeltaTimeZero)
Parameters:
bNextDeltaTimeZero
(System.Boolean)SetNextScene()
SetNextScene()()
SetOpenGlView()
SetOpenGlView()()
SetViewport()
SetViewport()()
Calls SetViewPortInPoints found in CCDrawManager. This will setup the project viewport.
Example
StartAnimation()
StartAnimation()()
StopAnimation()
StopAnimation()()
Update(GameTime)
Update(GameTime)(Microsoft.Xna.Framework.GameTime gameTime)
Parameters:
gameTime
(Microsoft.Xna.Framework.GameTime)