new Main(canvas, optionsopt)
The main Tily object. Initialises a canvas element and starts drawing tiles.
Parameters
Name | Type | Attributes | Description |
---|---|---|---|
canvas |
HTMLElement | The canvas element in which to draw tiles. |
|
options |
TilyOptions |
<optional> |
An optional object containing options for configuring this Tily instance. |
Members
(nullable) bufferTransition :Tily.BufferTransition
The currently running buffer transition or null if there is no currently running transition.
- Default Value:
- null
loop :number
A request id returned from window.requestAnimationFrame that uniquely identifies the entry in the callback list for the main render loop.
Methods
activateBuffer(buffer, optionsopt) → {Promise}
Activate a new buffer with an optional fade transition from the current buffer.
Parameters
Name | Type | Attributes | Description |
---|---|---|---|
buffer |
Tily.Buffer | The new buffer to activate. |
|
options |
TransitionOptions |
<optional> |
An optional options object. |
Returns
A promise instance for setting a transition finished callback.
- Type
- Promise