src/Director.js
function Director () {
    if (Director._instance) {
        throw new Error('Director instance already exists')
    }

    this.sceneStack = []
    this.window   = parent.window
    this.document = this.window.document

    // Prevent writing to some properties
    util.makeReadonly(this, 'canvas context sceneStack winSize isReady document window container isTouchScreen isMobile'.w)
}
function Director () {
    if (Director._instance) {
        throw new Error('Director instance already exists')
    }

    this.sceneStack = []
    this.window   = parent.window
    this.document = this.window.document

    // Prevent writing to some properties
    util.makeReadonly(this, 'canvas context sceneStack winSize isReady document window container isTouchScreen isMobile'.w)
}
function Director ( ) { if ( Director . _instance ) { throw new Error ( 'Director instance already exists' ) } this . sceneStack = [ ] this . window = parent . window this . document = this . window . document // Prevent writing to some properties util . makeReadonly ( this , 'canvas context sceneStack winSize isReady document window container isTouchScreen isMobile' . w ) }
Create a new instance of Director. This is a singleton so you shouldn't use
the constructor directly. Instead grab the shared instance using the
cocos.Director.sharedDirector property.

@class
Creates and handles the main view and manages how and when to execute the
Scenes.

This class is a singleton so don't instantiate it yourself, instead use
cocos.Director.sharedDirector to return the instance.

@memberOf cocos
@singleton
Create a new instance of Director . This is a singleton so you shouldn t use the constructor directly . Instead grab the shared instance using the cocos . Director . sharedDirector property .