mirror of
https://github.com/photonstorm/phaser
synced 2024-11-28 07:31:11 +00:00
Added Camera.alpha property
This commit is contained in:
parent
d20188b75d
commit
6dff47b71d
1 changed files with 32 additions and 4 deletions
|
@ -313,6 +313,16 @@ var Camera = new Class({
|
|||
*/
|
||||
this.backgroundColor = ValueToColor('rgba(0,0,0,0)');
|
||||
|
||||
/**
|
||||
* The Camera alpha value.
|
||||
*
|
||||
* @name Phaser.Cameras.Scene2D.Camera#alpha
|
||||
* @type {number}
|
||||
* @default 1
|
||||
* @since 3.11.0
|
||||
*/
|
||||
this.alpha = 1;
|
||||
|
||||
/**
|
||||
* The Camera Fade effect handler.
|
||||
* To fade this camera see the `Camera.fade` methods.
|
||||
|
@ -1317,10 +1327,23 @@ var Camera = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* Set the world bounds for this Camera.
|
||||
*
|
||||
* A Camera bounds controls where the camera can scroll to within the world. It does not limit
|
||||
* rendering of the camera, or placement of the viewport within your game.
|
||||
* Set the bounds of the Camera. The bounds are an axis-aligned rectangle.
|
||||
*
|
||||
* The Camera bounds controls where the Camera can scroll to, stopping it from scrolling off the
|
||||
* edges and into blank space. It does not limit the placement of Game Objects, or where
|
||||
* the Camera viewport can be positioned.
|
||||
*
|
||||
* Temporarily disable the bounds by changing the boolean `Camera.useBounds`.
|
||||
*
|
||||
* Clear the bounds entirely by calling `Camera.removeBounds`.
|
||||
*
|
||||
* If you set bounds that are smaller than the viewport it will stop the Camera from being
|
||||
* able to scroll. The bounds can be positioned where-ever you wish. By default they are from
|
||||
* 0x0 to the canvas width x height. This means that the coordinate 0x0 is the top left of
|
||||
* the Camera bounds. However, you can position them anywhere. So if you wanted a game world
|
||||
* that was 2048x2048 in size, with 0x0 being the center of it, you can set the bounds x/y
|
||||
* to be -1024, -1024, with a width and height of 2048. Depending on your game you may find
|
||||
* it easier for 0x0 to be the top-left of the bounds, or you may wish 0x0 to be the middle.
|
||||
*
|
||||
* @method Phaser.Cameras.Scene2D.Camera#setBounds
|
||||
* @since 3.0.0
|
||||
|
@ -1343,6 +1366,11 @@ var Camera = new Class({
|
|||
{
|
||||
this.centerToBounds();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.scrollX = this.clampX(this.scrollX);
|
||||
this.scrollY = this.clampY(this.scrollY);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue