File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -314,7 +314,9 @@ var Camera = new Class({
314314 this . backgroundColor = ValueToColor ( 'rgba(0,0,0,0)' ) ;
315315
316316 /**
317- * The Camera alpha value.
317+ * The Camera alpha value. Setting this property impacts every single object that this Camera
318+ * renders. You can either set the property directly, i.e. via a Tween, to fade a Camera in or out,
319+ * or via the chainable `setAlpha` method instead.
318320 *
319321 * @name Phaser.Cameras.Scene2D.Camera#alpha
320322 * @type {number }
@@ -510,6 +512,26 @@ var Camera = new Class({
510512 this . _follow = null ;
511513 } ,
512514
515+ /**
516+ * Set the Alpha level of this Camera. The alpha controls the opacity of the Camera as it renders.
517+ * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque.
518+ *
519+ * @method Phaser.GameObjects.Components.Origin#setAlpha
520+ * @since 3.11.0
521+ *
522+ * @param {number } [value=1] - The Camera alpha value.
523+ *
524+ * @return {this } This Camera instance.
525+ */
526+ setAlpha : function ( value )
527+ {
528+ if ( value === undefined ) { value = 1 ; }
529+
530+ this . alpha = value ;
531+
532+ return this ;
533+ } ,
534+
513535 /**
514536 * Sets the rotation origin of this Camera.
515537 *
You can’t perform that action at this time.
0 commit comments