Skip to content

Commit 9d6d312

Browse files
committed
Few more reference fixes.
1 parent e9fb8f6 commit 9d6d312

2 files changed

Lines changed: 15 additions & 14 deletions

File tree

src/core/Game.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ Phaser.Game.prototype = {
534534

535535
this.renderer = new PIXI.CanvasRenderer(this.width, this.height, this.canvas, this.transparent);
536536
Phaser.Canvas.setSmoothingEnabled(this.renderer.context, this.antialias);
537-
this.canvas = this.renderer.view;
537+
// this.canvas = this.renderer.view;
538538
this.context = this.renderer.context;
539539
}
540540
else
@@ -547,12 +547,15 @@ Phaser.Game.prototype = {
547547
// They requested WebGL, and their browser supports it
548548
this.renderType = Phaser.WEBGL;
549549
this.renderer = new PIXI.WebGLRenderer(this.width, this.height, this.canvas, this.transparent, this.antialias);
550-
this.canvas = this.renderer.view;
550+
// this.canvas = this.renderer.view;
551551
this.context = null;
552552
}
553553

554-
Phaser.Canvas.addToDOM(this.renderer.view, this.parent, true);
555-
Phaser.Canvas.setTouchAction(this.renderer.view);
554+
// Phaser.Canvas.addToDOM(this.renderer.view, this.parent, true);
555+
// Phaser.Canvas.setTouchAction(this.renderer.view);
556+
557+
Phaser.Canvas.addToDOM(this.canvas, this.parent, true);
558+
Phaser.Canvas.setTouchAction(this.canvas);
556559

557560
},
558561

src/core/Stage.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,20 @@ Phaser.Stage.prototype.parseConfig = function (config) {
8181

8282
if (config['canvasID'])
8383
{
84-
this.canvas = Phaser.Canvas.create(this.game.width, this.game.height, config['canvasID']);
84+
this.game.canvas = Phaser.Canvas.create(this.game.width, this.game.height, config['canvasID']);
8585
}
8686
else
8787
{
88-
this.canvas = Phaser.Canvas.create(this.game.width, this.game.height);
88+
this.game.canvas = Phaser.Canvas.create(this.game.width, this.game.height);
8989
}
9090

9191
if (config['canvasStyle'])
9292
{
93-
this.canvas.stlye = config['canvasStyle'];
93+
this.game.canvas.stlye = config['canvasStyle'];
9494
}
9595
else
9696
{
97-
this.canvas.style['-webkit-full-screen'] = 'width: 100%; height: 100%';
97+
this.game.canvas.style['-webkit-full-screen'] = 'width: 100%; height: 100%';
9898
}
9999

100100
if (config['checkOffsetInterval'])
@@ -131,7 +131,7 @@ Phaser.Stage.prototype.parseConfig = function (config) {
131131
*/
132132
Phaser.Stage.prototype.boot = function () {
133133

134-
Phaser.Canvas.getOffset(this.canvas, this.offset);
134+
Phaser.Canvas.getOffset(this.game.canvas, this.offset);
135135

136136
this.bounds = new Phaser.Rectangle(this.offset.x, this.offset.y, this.game.width, this.game.height);
137137

@@ -141,10 +141,8 @@ Phaser.Stage.prototype.boot = function () {
141141
return _this.visibilityChange(event);
142142
}
143143

144-
Phaser.Canvas.setUserSelect(this.canvas, 'none');
145-
Phaser.Canvas.setTouchAction(this.canvas, 'none');
146-
147-
// this.backgroundColor = '#000000';
144+
Phaser.Canvas.setUserSelect(this.game.canvas, 'none');
145+
Phaser.Canvas.setTouchAction(this.game.canvas, 'none');
148146

149147
document.addEventListener('visibilitychange', this._onChange, false);
150148
document.addEventListener('webkitvisibilitychange', this._onChange, false);
@@ -166,7 +164,7 @@ Phaser.Stage.prototype.update = function () {
166164
{
167165
if (this.game.time.now > this._nextOffsetCheck)
168166
{
169-
Phaser.Canvas.getOffset(this.canvas, this.offset);
167+
Phaser.Canvas.getOffset(this.game.canvas, this.offset);
170168
this._nextOffsetCheck = this.game.time.now + this.checkOffsetInterval;
171169
}
172170

0 commit comments

Comments
 (0)