mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 06:28:30 +00:00
Sorting out the Stage background color assignment so we can drop a boolean check in the render method.
This commit is contained in:
parent
5a1a918a5d
commit
705cacf2ca
2 changed files with 13 additions and 3 deletions
|
@ -312,8 +312,15 @@ Phaser.Stage.prototype.visibilityChange = function (event) {
|
|||
Phaser.Stage.prototype.setBackgroundColor = function(backgroundColor)
|
||||
{
|
||||
var rgb = Phaser.Color.valueToColor(backgroundColor);
|
||||
|
||||
this._backgroundColor = Phaser.Color.getColor(rgb.r, rgb.g, rgb.b);
|
||||
|
||||
// this.r = rgb.r / 255;
|
||||
// this.g = rgb.g / 255;
|
||||
// this.b = rgb.b / 255;
|
||||
|
||||
// this.canvasFill = rgb.rgba;
|
||||
|
||||
this.backgroundColorSplit = [ rgb.r / 255, rgb.g / 255, rgb.b / 255 ];
|
||||
this.backgroundColorString = Phaser.Color.RGBtoString(rgb.r, rgb.g, rgb.b, 255, '#');
|
||||
|
||||
|
|
|
@ -32,10 +32,13 @@ PIXI.Stage = function(backgroundColor)
|
|||
*/
|
||||
this.worldTransform = new PIXI.Matrix();
|
||||
|
||||
//the stage is its own stage
|
||||
this.stage = this;
|
||||
|
||||
this.setBackgroundColor(backgroundColor);
|
||||
this.r = 0;
|
||||
this.g = 0;
|
||||
this.b = 0;
|
||||
this.a = 0;
|
||||
// this.setBackgroundColor(backgroundColor);
|
||||
};
|
||||
|
||||
// constructor
|
||||
|
@ -64,7 +67,6 @@ PIXI.Stage.prototype.updateTransform = function()
|
|||
* @method setBackgroundColor
|
||||
* @param backgroundColor {Number} the color of the background, easiest way to pass this in is in hex format
|
||||
* like: 0xFFFFFF for white
|
||||
*/
|
||||
PIXI.Stage.prototype.setBackgroundColor = function(backgroundColor)
|
||||
{
|
||||
this.backgroundColor = backgroundColor || 0x000000;
|
||||
|
@ -73,3 +75,4 @@ PIXI.Stage.prototype.setBackgroundColor = function(backgroundColor)
|
|||
hex = '000000'.substr(0, 6 - hex.length) + hex;
|
||||
this.backgroundColorString = '#' + hex;
|
||||
};
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue