- 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
- This change uses a secondary canvas and rectangle clearing instead of a
'copy' composition on the same canvas. This should hopefully address
the flickering issue in Safari and Safari Mobile
TilemapLayer
- Added "delta scroll rendering"
- Enabled (by default) via `renderSettings.enableScrollDelta`
- Dramatic CPU reduction: 30% to 2% scrolling 50x37 region
- Side-effect: fixed some Chrome de-opt issues with `render`
- Various rendering updates and removal of many `_mc` field
- Made `index` a read-only propert that reflects the layer.index
- Creates a local cache from tile index -> tileset, added `resetTilesetCache`
- Also prevents crash when an index not associated with a tileset is
used; see `missingImageOverfill`.
- Various debug options moved to `debugSettings` and simplified; documentation updated.
- Uses `debugSettings.missingImageOverfill` and `tileColor` (deprecated) to display invalid tileset images
- Only change the context alpha when the tile alpha changes; in Chrome 38
this removed a .5% penalty
- Added `renderSettings` which controls misc. rendering/optimizations.
- Updated documentation to @member, clarified
Tileset
- Added `containsTileIndex` method to allow being queried if the specific tile index is handled/supported.
- Uses a firstgid bias and interlacing to fit the data in single densely packed array.
- Updated documentation to @member, clarified
TilemapLayer.wrap property - if true the map is rendered as if it is on the surface of a toroid (donut) instead of a plane. This allows for games that seamlessly scroll from one edge to the opposite edge of the world without noticing the transition. Note that the World size must match the Map size (thanks @jotson #851)
Prior to this change, TilemapLayers always restricted themselves to
rendering strictly within the world bounds. If the camera was allowed
to go beyond the world bounds, then the tilemap would appear to stop
scrolling once the camera hit the world edge. This allows the tilemap
to continue scrolling, showing empty space beyond the edge of the map.
Additionally, when the new "wrap" parameter is true, the tilemap will
render its opposite edge in the empty space. This simulates the map as
if it was the surface of a toroid (donut) rather than a flat plane.