mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 15:14:47 +00:00
A Canvas style set from a game config object used an incorrect property (thanks @TatumCreative, fix #861)
This commit is contained in:
parent
edc1507b4e
commit
6e8694d5f7
3 changed files with 28 additions and 25 deletions
|
@ -60,10 +60,11 @@ Version 2.0.6 - "Jornhill" - -in development-
|
|||
* RetroFont now uses Phaser.scaleModes.NEAREST by default for its RenderTexture to preserve scaling.
|
||||
* Loader.tilemap has renamed the `mapURL` parameter to `url` and `mapData` to `data` to keep it consistent with the other Loader methods.
|
||||
* Loader.physics has renamed the `dataURL` parameter to `url` and `jsonData` to `data` to keep it consistent with the other Loader methods.
|
||||
* Stage no longer creates the Phaser.Canvas object, but Game itself does in the setupRenderer method.
|
||||
|
||||
### CocoonJS Specific Updates
|
||||
|
||||
* Wrapped all touch, keyboard, mouse and fulscreen events that CocoonJS doesn't support in conditional checks to avoid Warnings.
|
||||
* Wrapped all touch, keyboard, mouse and fullscreen events that CocoonJS doesn't support in conditional checks to avoid Warnings.
|
||||
* The SoundManager no longer requires a touch to unlock it, defaults to unlocked.
|
||||
* Resolved issue where Cocoon won't render a scene in Canvas mode if there is only one Sprite/Image on it.
|
||||
|
||||
|
@ -96,6 +97,7 @@ Version 2.0.6 - "Jornhill" - -in development-
|
|||
* Sprite animation data wasn't reset when going from a sprite sheet to a single frame in Sprite.loadTexture (thanks @lucbloom, fix #850)
|
||||
* Timer.ms would report the game time ms value if the Timer hadn't yet been started, instead of 0.
|
||||
* Timer.seconds would report the game time value if the Timer hadn't yet been started, instead of 0.
|
||||
* A Canvas style set from a game config object used an incorrect property (thanks @TatumCreative, fix #861)
|
||||
|
||||
### Migration Guide
|
||||
|
||||
|
|
|
@ -549,6 +549,30 @@ Phaser.Game.prototype = {
|
|||
this.renderType = Phaser.CANVAS;
|
||||
}
|
||||
|
||||
if (this.config['canvasID'])
|
||||
{
|
||||
this.canvas = Phaser.Canvas.create(this.width, this.height, this.config['canvasID']);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.canvas = Phaser.Canvas.create(this.width, this.height);
|
||||
}
|
||||
|
||||
if (this.config['canvasStyle'])
|
||||
{
|
||||
this.canvas.style = this.config['canvasStyle'];
|
||||
}
|
||||
else
|
||||
{
|
||||
this.canvas.style['-webkit-full-screen'] = 'width: 100%; height: 100%';
|
||||
}
|
||||
|
||||
if (this.device.cocoonJS)
|
||||
{
|
||||
// Enable screencanvas for Cocoon on this Canvas object only
|
||||
this.canvas.screencanvas = true;
|
||||
}
|
||||
|
||||
if (this.renderType === Phaser.HEADLESS || this.renderType === Phaser.CANVAS || (this.renderType === Phaser.AUTO && this.device.webGL === false))
|
||||
{
|
||||
if (this.device.canvas)
|
||||
|
|
|
@ -32,7 +32,7 @@ Phaser.Stage = function (game, width, height) {
|
|||
*/
|
||||
this.bounds = new Phaser.Rectangle(0, 0, width, height);
|
||||
|
||||
PIXI.Stage.call(this, 0x000000, false);
|
||||
PIXI.Stage.call(this, 0x000000);
|
||||
|
||||
/**
|
||||
* @property {string} name - The name of this object.
|
||||
|
@ -92,11 +92,6 @@ Phaser.Stage = function (game, width, height) {
|
|||
{
|
||||
this.parseConfig(game.config);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.game.canvas = Phaser.Canvas.create(width, height);
|
||||
this.game.canvas.style['-webkit-full-screen'] = 'width: 100%; height: 100%';
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
@ -198,24 +193,6 @@ Phaser.Stage.prototype.postUpdate = function () {
|
|||
*/
|
||||
Phaser.Stage.prototype.parseConfig = function (config) {
|
||||
|
||||
if (config['canvasID'])
|
||||
{
|
||||
this.game.canvas = Phaser.Canvas.create(this.game.width, this.game.height, config['canvasID']);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.game.canvas = Phaser.Canvas.create(this.game.width, this.game.height);
|
||||
}
|
||||
|
||||
if (config['canvasStyle'])
|
||||
{
|
||||
this.game.canvas.stlye = config['canvasStyle'];
|
||||
}
|
||||
else
|
||||
{
|
||||
this.game.canvas.style['-webkit-full-screen'] = 'width: 100%; height: 100%';
|
||||
}
|
||||
|
||||
if (config['checkOffsetInterval'])
|
||||
{
|
||||
this.checkOffsetInterval = config['checkOffsetInterval'];
|
||||
|
|
Loading…
Reference in a new issue