You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Memory optimization of delta-scroll shifting.
- The copy canvas is shared between all TilemapLayers
- The copy is done in segments to reduce the memory usage of the copy
canvas. Currently this is a 1/4 ratio.
- Device has the feature (by browser) check to see if bitblt works
- TilemapLayer will automatically enable the double-copy as needed
- Device.whenReady can be used to override the device value
device.webGL=(function(){try{varcanvas=document.createElement('canvas');/*Force screencanvas to false*/canvas.screencanvas=false;return!!window.WebGLRenderingContext&&(canvas.getContext('webgl')||canvas.getContext('experimental-webgl'));}catch(e){returnfalse;}})();
647
654
648
-
if(device.webGL===null||device.webGL===false)
649
-
{
650
-
device.webGL=false;
651
-
}
652
-
else
653
-
{
654
-
device.webGL=true;
655
-
}
655
+
device.webGL=(function(){try{varcanvas=document.createElement('canvas');/*Force screencanvas to false*/canvas.screencanvas=false;return!!window.WebGLRenderingContext&&(canvas.getContext('webgl')||canvas.getContext('experimental-webgl'));}catch(e){returnfalse;}})();
656
+
device.webGL=!!device.webGL;
656
657
657
658
device.worker=!!window['Worker'];
658
659
@@ -662,6 +663,17 @@ Phaser.Device._initialize = function () {
* Settings that control standard (non-diagnostic) rendering.
132
127
*
133
-
* @public
134
-
* @property {boolean} enableScrollDelta - When enabled, only new newly exposed areas of the layer are redraw after scrolling. This can greatly improve scrolling rendering performance, especially when there are many small tiles.
128
+
* @property {boolean} [enableScrollDelta=true] - Delta scroll rendering only draws tiles/edges as them come into view.
129
+
* This can greatly improve scrolling rendering performance, especially when there are many small tiles.
130
+
* It should only be disabled in rare cases.
131
+
*
132
+
* @property {?DOMCanvasElement} [copyCanvas=(auto)] - [Internal] If set, force using a separate (shared) copy canvas.
133
+
* Using a canvas bitblt/copy when the source and destinations region overlap produces unexpected behavior
134
+
* in some browsers, notably Safari.
135
+
*
136
+
* @property {integer} copySliceCount - [Internal] The number of vertical slices to copy when using a `copyCanvas`.
137
+
* This is ratio of the pixel count of the primary canvas to the copy canvas.
* Returns the appropriate tileset for the index, updating the internal cache as required. This should only be called if `tilesets[index]` evaluates to undefined.
632
+
* Returns the appropriate tileset for the index, updating the internal cache as required.
633
+
* This should only be called if `tilesets[index]` evaluates to undefined.
601
634
*
602
635
* @method Phaser.TilemapLayer#resolveTileset
603
636
* @private
@@ -631,7 +664,9 @@ Phaser.TilemapLayer.prototype.resolveTileset = function (tileIndex)
631
664
};
632
665
633
666
/**
634
-
* The TilemapLayer caches tileset look-ups. Call this method of clear the cache if tilesets have been added or updated after the layer has been rendered.
667
+
* The TilemapLayer caches tileset look-ups.
668
+
*
669
+
* Call this method of clear the cache if tilesets have been added or updated after the layer has been rendered.
635
670
*
636
671
* @method Phaser.TilemapLayer#resetTilesetCache
637
672
* @public
@@ -648,15 +683,19 @@ Phaser.TilemapLayer.prototype.resetTilesetCache = function ()
648
683
649
684
/**
650
685
* Shifts the contents of the canvas - does extra math so that different browsers agree on the result.
686
+
*
651
687
* The specified (x/y) will be shifted to (0,0) after the copy and the newly exposed canvas area will need to be filled in.
652
688
*
689
+
* If `copyCanvas` is specified it will be used as an intermediate copy buffer and may be resized.
690
+
*
653
691
* @method Phaser.TilemapLayer#shiftCanvas
654
692
* @private
655
693
* @param {CanvasRenderingContext2D} context - The context to shift
656
694
* @param {integer} x
657
695
* @param {integer} y
696
+
* @param {DOMCanvasElement} [copyCanvas=(none)] - If specified this canvas will be used as an intermediate copy buffer.
0 commit comments