@@ -413,6 +413,62 @@ Phaser.ScaleManager.RESIZE = 3;
413413
414414Phaser . ScaleManager . prototype = {
415415
416+ /**
417+ * Calculates and sets the game dimensions based on the given width and height.
418+ * This is used internally.
419+ *
420+ * @method Phaser.ScaleManager#boot
421+ * @protected
422+ */
423+ boot : function ( ) {
424+
425+ this . supportsFullScreen = this . game . device . fullscreen && ! this . game . device . cocoonJS ;
426+
427+ // Now the canvas has been created we can target it
428+ this . fullScreenTarget = this . game . canvas ;
429+
430+ var _this = this ;
431+
432+ this . _orientationChange = function ( event ) {
433+ return _this . orientationChange ( event ) ;
434+ } ;
435+
436+ this . _windowResize = function ( event ) {
437+ return _this . windowResize ( event ) ;
438+ } ;
439+
440+ window . addEventListener ( 'orientationchange' , this . _orientationChange , false ) ;
441+ window . addEventListener ( 'resize' , this . _windowResize , false ) ;
442+
443+ if ( this . supportsFullScreen )
444+ {
445+ this . _fullScreenChange = function ( event ) {
446+ return _this . fullScreenChange ( event ) ;
447+ } ;
448+
449+ this . _fullScreenError = function ( event ) {
450+ return _this . fullScreenError ( event ) ;
451+ } ;
452+
453+ document . addEventListener ( 'webkitfullscreenchange' , this . _fullScreenChange , false ) ;
454+ document . addEventListener ( 'mozfullscreenchange' , this . _fullScreenChange , false ) ;
455+ document . addEventListener ( 'MSFullscreenChange' , this . _fullScreenChange , false ) ;
456+ document . addEventListener ( 'fullscreenchange' , this . _fullScreenChange , false ) ;
457+
458+ document . addEventListener ( 'webkitfullscreenerror' , this . _fullScreenError , false ) ;
459+ document . addEventListener ( 'mozfullscreenerror' , this . _fullScreenError , false ) ;
460+ document . addEventListener ( 'MSFullscreenError' , this . _fullScreenError , false ) ;
461+ document . addEventListener ( 'fullscreenerror' , this . _fullScreenError , false ) ;
462+ }
463+
464+ this . updateDimensions ( this . width , this . height , true ) ;
465+
466+ Phaser . Canvas . getOffset ( this . game . canvas , this . offset ) ;
467+
468+ this . bounds . setTo ( this . offset . x , this . offset . y , this . width , this . height ) ;
469+
470+ } ,
471+
416472 /**
417473 * Load configuration settings.
418474 *
@@ -524,62 +580,6 @@ Phaser.ScaleManager.prototype = {
524580
525581 } ,
526582
527- /**
528- * Calculates and sets the game dimensions based on the given width and height.
529- * This is used internally.
530- *
531- * @method Phaser.ScaleManager#boot
532- * @protected
533- */
534- boot : function ( ) {
535-
536- this . supportsFullScreen = this . game . device . fullscreen && ! this . game . device . cocoonJS ;
537-
538- // Now the canvas has been created we can target it
539- this . fullScreenTarget = this . game . canvas ;
540-
541- var _this = this ;
542-
543- this . _orientationChange = function ( event ) {
544- return _this . orientationChange ( event ) ;
545- } ;
546-
547- this . _windowResize = function ( event ) {
548- return _this . windowResize ( event ) ;
549- } ;
550-
551- window . addEventListener ( 'orientationchange' , this . _orientationChange , false ) ;
552- window . addEventListener ( 'resize' , this . _windowResize , false ) ;
553-
554- if ( this . supportsFullScreen )
555- {
556- this . _fullScreenChange = function ( event ) {
557- return _this . fullScreenChange ( event ) ;
558- } ;
559-
560- this . _fullScreenError = function ( event ) {
561- return _this . fullScreenError ( event ) ;
562- } ;
563-
564- document . addEventListener ( 'webkitfullscreenchange' , this . _fullScreenChange , false ) ;
565- document . addEventListener ( 'mozfullscreenchange' , this . _fullScreenChange , false ) ;
566- document . addEventListener ( 'MSFullscreenChange' , this . _fullScreenChange , false ) ;
567- document . addEventListener ( 'fullscreenchange' , this . _fullScreenChange , false ) ;
568-
569- document . addEventListener ( 'webkitfullscreenerror' , this . _fullScreenError , false ) ;
570- document . addEventListener ( 'mozfullscreenerror' , this . _fullScreenError , false ) ;
571- document . addEventListener ( 'MSFullscreenError' , this . _fullScreenError , false ) ;
572- document . addEventListener ( 'fullscreenerror' , this . _fullScreenError , false ) ;
573- }
574-
575- this . updateDimensions ( this . width , this . height , true ) ;
576-
577- Phaser . Canvas . getOffset ( this . game . canvas , this . offset ) ;
578-
579- this . bounds . setTo ( this . offset . x , this . offset . y , this . width , this . height ) ;
580-
581- } ,
582-
583583 /**
584584 * Sets the callback that will be called when the window resize event occurs, or if set the parent container changes dimensions.
585585 * Use this to handle responsive game layout options.
@@ -601,7 +601,7 @@ Phaser.ScaleManager.prototype = {
601601 /**
602602 * Set the min and max dimensions for the game object.
603603 *
604- * @method setMinMax
604+ * @method Phaser.ScaleManager# setMinMax
605605 * @public
606606 * @param {number } minWidth - The minimum width the game is allowed to scale down to.
607607 * @param {number } minHeight - The minimum height the game is allowed to scale down to.
@@ -946,6 +946,7 @@ Phaser.ScaleManager.prototype = {
946946 * Set screen (game canvas) size automatically based on the scaleMode.
947947 * This is only needed if `currentScaleMode` is not set to `RESIZE`.
948948 *
949+ * @method Phaser.ScaleManager#setScreenSize
949950 * @param {boolean } force - If force is true the resize will be forced immediately instead of waiting for a pending recomputation/callback.
950951 * @protected
951952 */
@@ -1022,9 +1023,9 @@ Phaser.ScaleManager.prototype = {
10221023 * @param {boolean } [fullscreen=(isFullScreen)] - Is fullscreen.
10231024 * @param {Phaser.Rectangle } [target=(new Rectangle)] - The rectangle to update; a new one is created as needed.
10241025 */
1025- // Not to be confused with `_parentBounds` which is used for RESIZE support and tracking.
10261026 getParentBounds : function ( fullscreen , target ) {
10271027
1028+ // Not to be confused with `_parentBounds` which is used for RESIZE support and tracking.
10281029 if ( typeof fullscreen === 'undefined' ) { fullscreen = this . isFullScreen ; }
10291030
10301031 var bounds = target || new Phaser . Rectangle ( ) ;
0 commit comments