• ig.BackgroundMap

ig.

BackgroundMapExtended

new BackgroundMapExtended()

Fixes and enhancements for background-maps. IMPORTANT: to greatly improve performance by reducing draw calls, all prerendered maps on a layer will be merged into as few maps as possible!

Author:
  • Collin Hover - collinhover.com
Source:

mergedMaps :Array

List of maps merged into this map.

Source:

preRenderedScale :Number

Scale at which maps were pre rendered.

Default Value:
  • 0
Source:

draw()

Draw background map.

Source:

merge(map) → {Boolean}

Merge another map into this map. IMPORTANT: only maps with ig.BackgroundMap#preRender set to true can be merged.

Parameters:
Name Type Description
map ig.BackgroundMap map to be merged.
Source:
Returns:
{ Boolean } true if merged

preRenderChunk()

Prerenders a chunk of a map.

Source:

preRenderMapToChunks()

Source:

preRenderMergedChunk(maps, chunkSize, cx, cy, w, h) → {*}

Prerenders a merged chunk of a map from a list of maps.

Parameters:
Name Type Description
maps Array maps to render from
chunkSize Number size of chunk
cx Number x position of chunk
cy Number y position of chunk
w Number width of chunk
h Number height of chunk
Source:
Returns:

setTileset()

Source: