@@ -32,18 +32,18 @@ var CanvasPool = function ()
3232 * @function Phaser.Display.Canvas.CanvasPool.create
3333 * @since 3.0.0
3434 *
35- * @param {any } parent - [description]
36- * @param {integer } [width=1] - [description]
37- * @param {integer } [height=1] - [description]
38- * @param {integer } [type ] - [description]
35+ * @param {any } parent - The parent of the Canvas object.
36+ * @param {integer } [width=1] - The width of the Canvas.
37+ * @param {integer } [height=1] - The height of the Canvas.
38+ * @param {integer } [canvasType=Phaser.CANVAS ] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`.
3939 *
4040 * @return {HTMLCanvasElement } [description]
4141 */
42- var create = function ( parent , width , height , type )
42+ var create = function ( parent , width , height , canvasType )
4343 {
4444 if ( width === undefined ) { width = 1 ; }
4545 if ( height === undefined ) { height = 1 ; }
46- if ( type === undefined ) { type = CONST . CANVAS ; }
46+ if ( canvasType === undefined ) { canvasType = CONST . CANVAS ; }
4747
4848 var canvas ;
4949 var container = first ( type ) ;
@@ -53,7 +53,7 @@ var CanvasPool = function ()
5353 container = {
5454 parent : parent ,
5555 canvas : document . createElement ( 'canvas' ) ,
56- type : type
56+ type : canvasType
5757 } ;
5858
5959 pool . push ( container ) ;
@@ -70,7 +70,7 @@ var CanvasPool = function ()
7070 canvas . width = width ;
7171 canvas . height = height ;
7272
73- if ( _disableContextSmoothing && type === CONST . CANVAS )
73+ if ( _disableContextSmoothing && canvasType === CONST . CANVAS )
7474 {
7575 Smoothing . disable ( canvas . getContext ( '2d' ) ) ;
7676 }
@@ -84,9 +84,9 @@ var CanvasPool = function ()
8484 * @function Phaser.Display.Canvas.CanvasPool.create2D
8585 * @since 3.0.0
8686 *
87- * @param {any } parent - [description]
88- * @param {integer } [width=1] - [description]
89- * @param {integer } [height=1] - [description]
87+ * @param {any } parent - The parent of the Canvas object.
88+ * @param {integer } [width=1] - The width of the Canvas.
89+ * @param {integer } [height=1] - The height of the Canvas.
9090 *
9191 * @return {HTMLCanvasElement } [description]
9292 */
@@ -101,9 +101,9 @@ var CanvasPool = function ()
101101 * @function Phaser.Display.Canvas.CanvasPool.createWebGL
102102 * @since 3.0.0
103103 *
104- * @param {any } parent - [description]
105- * @param {integer } [width=1] - [description]
106- * @param {integer } [height=1] - [description]
104+ * @param {any } parent - The parent of the Canvas object.
105+ * @param {integer } [width=1] - The width of the Canvas.
106+ * @param {integer } [height=1] - The height of the Canvas.
107107 *
108108 * @return {HTMLCanvasElement } [description]
109109 */
@@ -118,17 +118,17 @@ var CanvasPool = function ()
118118 * @function Phaser.Display.Canvas.CanvasPool.first
119119 * @since 3.0.0
120120 *
121- * @param {integer } [type ] - [description]
121+ * @param {integer } [canvasType=Phaser.CANVAS ] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`.
122122 *
123123 * @return {HTMLCanvasElement } [description]
124124 */
125- var first = function ( type )
125+ var first = function ( canvasType )
126126 {
127- if ( type === undefined ) { type = CONST . CANVAS ; }
127+ if ( canvasType === undefined ) { canvasType = CONST . CANVAS ; }
128128
129129 pool . forEach ( function ( container )
130130 {
131- if ( ! container . parent && container . type === type )
131+ if ( ! container . parent && container . type === canvasType )
132132 {
133133 return container ;
134134 }
0 commit comments