Skip to main content

CCApplication

CCApplication

Cocos2D

Inheritance: System.Object

Constructors

CCApplication(Game, IGraphicsDeviceService)

CCApplication(Game, IGraphicsDeviceService)(Microsoft.Xna.Framework.Game game, Microsoft.Xna.Framework.Graphics.IGraphicsDeviceService service)
Parameters:
game (Microsoft.Xna.Framework.Game)
service (Microsoft.Xna.Framework.Graphics.IGraphicsDeviceService)

Fields

GameTime(Microsoft.Xna.Framework.GameTime)
m_bCaptured(System.Boolean)
m_pDelegate(Cocos2D.ICCEGLTouchDelegate)
s_pSharedApplication(Cocos2D.CCApplication)

Properties

AnimationInterval(System.Double)

Callback by CCDirector for limit FPS

Content(Microsoft.Xna.Framework.Content.ContentManager)

This returns the shared CCContentManager.

HandleMediaStateAutomatically(System.Boolean)
SharedApplication(Cocos2D.CCApplication)

Get current applicaiton instance.

TouchDelegate(Cocos2D.ICCEGLTouchDelegate)
UseInputStateManagement(System.Boolean)

Override and set to true if you want to use CCInputState to manage the input to the application. This will give you access to the gesture state of the app.

Methods

ApplicationDidEnterBackground()

ApplicationDidEnterBackground()()

Called when the game enters the background. This happens when the 'windows' button is pressed on a WP phone. On Android, it happens when the device is ide or the power button is pressed.

Example

ApplicationDidFinishLaunching()

System.Boolean ApplicationDidFinishLaunching()()

Implement CCDirector and CCScene init code here.

Returns:
System.Boolean - return true Initialize success, app continue. return false Initialize failed, app terminate.
Example

ApplicationWillEnterForeground()

ApplicationWillEnterForeground()()

Called when the game returns to the foreground, such as when the game is launched after being paused.

Example

ClearTouches()

ClearTouches()()

Draw(GameTime)

Draw(GameTime)(Microsoft.Xna.Framework.GameTime gameTime)
Parameters:
gameTime (Microsoft.Xna.Framework.GameTime)
Example

InitInstance()

System.Boolean InitInstance()()

Implement for initialize OpenGL instance, set source path, etc...

Returns:
System.Boolean
Example

Initialize()

Initialize()()
Example

LoadContent()

LoadContent()()

Loads the content for the game and then calls ApplicationDidFinishLaunching.

Example

Update(GameTime)

Update(GameTime)(Microsoft.Xna.Framework.GameTime gameTime)

Allows the game component to update itself.

Parameters:
gameTime (Microsoft.Xna.Framework.GameTime) - Provides a snapshot of timing values.
Example

Events

GamePadButtonUpdate(Event)
GamePadConnectionUpdate(Event)
GamePadDPadUpdate(Event)
GamePadStickUpdate(Event)
GamePadTriggerUpdate(Event)
OnGesture(Event)