Constructor
(abstract) new Scene(options)
Create a new Scene with the specified options.
Parameters:
Name | Type | Description |
---|---|---|
options |
object | The options for the GameEngine, composed of the properties. |
Properties:
Name | Type | Description |
---|---|---|
asset |
Asset | The Asset to use for the Scene tiles |
parent |
Object | The parent of this Scene |
x |
integer | The x-coordinate in pixels relative to its parent (optional, default 0) |
y |
integer | The y-coordinate in pixels relative to its parent (optional, default 0) |
z |
integer | The z-coordinate relative to its parent (optional, default 0) |
scale |
float | The current scale (zoom) where 1 = 100% (optional, default 1) |
visible |
boolean | Set if this Scene is visible (optional, default true) |
enableScroll |
boolean | Enable mouse scrolling (optional, default true) |
- Mixes In:
- Source:
Members
(static) PERSPECTIVE_ANGLE
In PERSPECTIVE_ANGLE mode, a Scene will draw all tile levels, subscenes and entities in order from their z and y coordinates modified their hotspot y coordinate.
(static) PERSPECTIVE_OVERHEAD
In PERSPECTIVE_OVERHEAD mode, a Scene will simply draw all tile levels, subscenes and entities in order from their z-coordinate.
Methods
draw(context)
Draw the Scene into the given context. You should override draw with your draw logic.
Parameters:
Name | Type | Description |
---|---|---|
context |
CanvasRenderingContext2D | The context in which to draw |
redraw()
Mark this scene to be redran.