Constructor
new LevelEditor()
- Source
levelEditor.onRestart = ()=> loadLevel(); // adds a Restart button that rebuilds the level
levelEditor.onTile = (layer, pos, tile)=> layer.setCollisionData(pos, tile === ladderTile ? -1 : tile ? 1 : 0);Members
isOpen
True while the editor is open, the game is paused under it
- Source
onPlayFrom :EditorPlayFromCallback|undefined
- EditorPlayFromCallback |
undefined
| Type | Description |
|---|---|
| function | | Put the player at a world position; with it, the editor's Advanced section has Play from mouse, which starts play there, Escape at the mouse and Play at the view center |
- Source
onRestart :EditorRestartCallback|undefined
- EditorRestartCallback |
undefined
| Type | Description |
|---|---|
| function | | Rebuild the level from the map the editor changed, a Restart button calls it after switching to play; without one there is no Restart button |
- Source
onTile :EditorTileCallback|undefined
- EditorTileCallback |
undefined
| Type | Description |
|---|---|
| EditorTileCallback | | What the game does when the editor paints a tile, like setting its collision or its look the way the game does when it loads the level; without one, the collision layer gets collision 1 where there is a tile |
- Source
paletteTiles :Array.<number>|undefined
- Array.<number> |
undefined
| Type | Description |
|---|---|
| Array.<number> | | The tiles the palette shows, in its order, for a sheet that also holds sprites and art that are not level tiles; undefined shows every tile of the sheet |
- Source
use3D :boolean|undefined
- boolean |
undefined
| Type | Description |
|---|---|
| boolean | | Which level editor opens: true the 3D one, false the 2D one, undefined the 3D one when a level was loaded with level3DLoad and there is a Render3DPlugin |
- Source
Methods
close()
Close the editor and end its session, the game carries on with the changes and Escape opens the debug overlay again
- Source
open()
Open the editor, pausing the game; until close(), Escape (the debug key) switches between playing and editing
- Source