Skip to content

MapEditor

Type

MapEditor

Map editing context for the currently open map editor in SLADE.

Properties

Property Type Description
editMode integer The current edit mode (see MODE_ constants below)
sectorEditMode integer The current sector edit mode (see SECTORMODE_ constants below)
gridSize integer The current grid size
map Map The map associated with this editor

Constants

Name Value
MODE_VERTICES 0
MODE_LINES 1
MODE_SECTORS 2
MODE_THINGS 3
MODE_VISUAL 4
SECTORMODE_BOTH 0
SECTORMODE_FLOOR 1
SECTORMODE_CEILING 2

Constructors

No Constructors

This type can not be created directly in scripts.

See:

Functions

Overview

General

SetEditMode(mode, [sectorMode])

Selection

ClearSelection() Select(object, [add]) SelectedLines([tryHighlight]) -> MapLine[] SelectedSectors([tryHighlight]) -> MapSector[] SelectedThings([tryHighlight]) -> MapThing[] SelectedVertices([tryHighlight]) -> MapVertex[]


SetEditMode

Sets the edit mode to the given mode. If the mode is being set to MODE_SECTORS, the sectorMode parameter can be given to specify the sector edit mode.

Parameters

  • mode (integer): The edit mode to switch to (see MODE_ constants)
  • [sectorMode] (integer): The sector edit mode to switch to (see SECTORMODE_ constants). Default is SECTORMODE_BOTH

ClearSelection

Deselects all currently selected items


Select

Selects or deselects the given MapObject (or derived type), depending on add.

Parameters

  • object (MapObject): The MapObject to (de)select
  • [add] (boolean): Whether to add (true) or remove (false) from the current selection. Default is true

SelectedLines

Parameters

  • [tryHighlight] (boolean): Whether to get the current highlight if nothing is selected. Default is false

Returns

  • MapLine[]: An array of all currently selected lines

Notes

If nothing is selected and tryHighlight is true, the currently highlighted line is returned in the array.


SelectedSectors

Parameters

  • [tryHighlight] (boolean): Whether to get the current highlight if nothing is selected. Default is false

Returns

  • MapSector[]: An array of all currently selected sectors

Notes

If nothing is selected and tryHighlight is true, the currently highlighted sector is returned in the array.


SelectedThings

Parameters

  • [tryHighlight] (boolean): Whether to get the current highlight if nothing is selected. Default is false

Returns

  • MapThing[]: An array of all currently selected things

Notes

If nothing is selected and tryHighlight is true, the currently highlighted thing is returned in the array.


SelectedVertices

Parameters

  • [tryHighlight] (boolean): Whether to get the current highlight if nothing is selected. Default is false

Returns

  • MapVertex[]: An array of all currently selected vertices

Notes

If nothing is selected and tryHighlight is true, the currently highlighted vertex is returned in the array.