mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 13:13:43 +00:00
Remove un-needed mixin components leaving only FixedToCamera (not sure about this one). Move this.fixedToCamera after the Core.init call which creates the underlying core components required. Add temporary instant return from shiftCanvas in case that was being called and contributing to the slow-down (probably not).
This commit is contained in:
parent
ef4143136e
commit
5e97f10c86
1 changed files with 22 additions and 19 deletions
|
@ -219,35 +219,36 @@ Phaser.TilemapLayerGL = function (game, tilemap, index, width, height) {
|
|||
this.renderSettings.copyCanvas = Phaser.TilemapLayerGL.ensureSharedCopyCanvas();
|
||||
}
|
||||
|
||||
//this.fixedToCamera = true;
|
||||
|
||||
var baseTexture = new PIXI.BaseTexture(this.map.tilesets[0].image);
|
||||
PIXI.Tilemap.call(this, new PIXI.Texture(baseTexture), this.map.width, this.map.height, this.map.tileWidth, this.map.tileHeight, this.layer);
|
||||
|
||||
Phaser.Component.Core.init.call(this, game, 0, 0, null, null);
|
||||
|
||||
// must be called after the Core.init
|
||||
this.fixedToCamera = true;
|
||||
};
|
||||
|
||||
Phaser.TilemapLayerGL.prototype = Object.create(PIXI.Tilemap.prototype);
|
||||
Phaser.TilemapLayerGL.prototype.constructor = Phaser.TilemapLayerGL;
|
||||
|
||||
Phaser.Component.Core.install.call(Phaser.TilemapLayerGL.prototype, [
|
||||
'Angle',
|
||||
'Animation',
|
||||
'AutoCull',
|
||||
'Bounds',
|
||||
'BringToTop',
|
||||
'Destroy',
|
||||
'FixedToCamera',
|
||||
'Health',
|
||||
'InCamera',
|
||||
'InputEnabled',
|
||||
'InWorld',
|
||||
'LifeSpan',
|
||||
'LoadTexture',
|
||||
'Overlap',
|
||||
'PhysicsBody',
|
||||
'Reset',
|
||||
'Smoothed'
|
||||
//'Angle',
|
||||
//'Animation',
|
||||
//'AutoCull',
|
||||
//'Bounds',
|
||||
//'BringToTop',
|
||||
//'Destroy',
|
||||
'FixedToCamera'
|
||||
//'Health',
|
||||
//'InCamera',
|
||||
//'InputEnabled',
|
||||
//'InWorld',
|
||||
//'LifeSpan',
|
||||
//'LoadTexture',
|
||||
//'Overlap',
|
||||
//'PhysicsBody',
|
||||
//'Reset',
|
||||
//'Smoothed'
|
||||
]);
|
||||
|
||||
Phaser.TilemapLayerGL.prototype.preUpdateCore = Phaser.Component.Core.preUpdate;
|
||||
|
@ -716,6 +717,8 @@ Phaser.TilemapLayerGL.prototype.setScale = function (xScale, yScale) {
|
|||
*/
|
||||
Phaser.TilemapLayerGL.prototype.shiftCanvas = function (context, x, y) {
|
||||
|
||||
return;
|
||||
|
||||
var canvas = context.canvas;
|
||||
var copyW = canvas.width - Math.abs(x);
|
||||
var copyH = canvas.height - Math.abs(y);
|
||||
|
|
Loading…
Reference in a new issue