Map
Properties
camera
VisualCamera object with information about the position of the camera in visual mode. Read-only.
isDoom
true if the map is in Doom format, false if it isn't. Read-only.
isHexen
true if the map is in Hexen format, false if it isn't. Read-only.
isUDMF
true if the map is in UDMF, false if it isn't. Read-only.
mousePosition
The map coordinates of the mouse position as a Vector2D. Read-only.
Methods
clearAllMarks(mark: bool)
Sets the marked property of all map elements. Can be passed true to mark all map elements.
Parameters
- mark:
falseto set themarkedproperty tofalse(default),trueto set themarkedproperty totrue
clearAllSelected()
Clears all selected map elements.
clearMarkeLinedefs(mark: bool)
Sets the marked property of all Linedefs. Can be passed true to mark all Linedefs.
Parameters
- mark:
falseto set themarkedproperty tofalse(default),trueto set themarkedproperty totrue
clearMarkeSectors(mark: bool)
Sets the marked property of all Sectors. Can be passed true to mark all Sectors.
Parameters
- mark:
falseto set themarkedproperty tofalse(default),trueto set themarkedproperty totrue
clearMarkeSidedefs(mark: bool)
Sets the marked property of all Sidedefs. Can be passed true to mark all Sidedefs.
Parameters
- mark:
falseto set themarkedproperty tofalse(default),trueto set themarkedproperty totrue
clearMarkedThings(mark: bool)
Sets the marked property of all Things. Can be passed true to mark all Things.
Parameters
- mark:
falseto set themarkedproperty tofalse(default),trueto set themarkedproperty totrue
clearMarkedVertices(mark: bool)
Sets the marked property of all vertices. Can be passed true to mark all vertices.
Parameters
- mark:
falseto set themarkedproperty tofalse(default),trueto set themarkedproperty totrue
clearSelectedSectors()
Clears all selected Sectors.
clearSelectedThings()
Clears all selected Things.
clearSelectedVertices()
Clears all selected vertices.
createThing(pos: object, type: int)
Creates a new Thing at the given position. The position can be a Vector2D, Vector3D, or an Array of two numbers or three numbers (note that the z position only works for game configurations that support vertical pos. A thing type can be supplied optionally.
var t1 = UDB.Map.createThing(new UDB.Vector2D(32, 64));
var t2 = UDB.Map.createThing([ 32, 64 ]);
var t3 = UDB.Map.createThing(new UDB.Vector2D(32, 64), 3001); // Create an Imp
var t4 = UDB.Map.createThing([ 32, 64 ], 3001); // Create an Imp
Parameters
- pos: Position where the
Thingshould be created at - type: Thing type (optional)
Return value
The new Thing
createVertex(pos: object)
Creates a new Vertex at the given position. The position can be a Vector2D or an Array of two numbers.
var v1 = UDB.Map.createVertex(new Vector2D(32, 64));
var v2 = UDB.Map.createVertex([ 32, 64 ]);
Parameters
- pos: Position where the
Vertexshould be created at
Return value
The created Vertex
drawLines(data: object)
Draws lines. Data has to be an Array of Array of numbers, Vector2Ds, Vector3Ds, or objects with x and y properties. Note that the first and last element have to be at the same positions to make a complete drawing.
UDB.Map.drawLines([
new UDB.Vector2D(64, 0),
new UDB.Vector2D(128, 0),
new UDB.Vector2D(128, 64),
new UDB.Vector2D(64, 64),
new UDB.Vector2D(64, 0)
]);
UDB.Map.drawLines([
[ 0, 0 ],
[ 64, 0 ],
[ 64, 64 ],
[ 0, 64 ],
[ 0, 0 ]
]);
Parameters
- data:
Arrayof positions
Return value
true if drawing was successful, false if it wasn't
getHighlightedLinedef()
Get the currently highlighted Linedef.
Return value
The currently highlighted Linedef or null if no Linedef is highlighted
getHighlightedSector()
Get the currently highlighted Sector.
Return value
The currently highlighted Sector or null if no Sector is highlighted
getHighlightedThing()
Get the currently highlighted Thing.
Return value
The currently highlighted Thing or null if no Thing is highlighted
getHighlightedVertex()
Get the currently highlighted Vertex.
Return value
The currently highlighted Vertex or null if no Vertex is highlighted
getLinedefs()
Returns an Array of all Linedefs in the map.
Return value
Array of Linedefs
getMarkedLinedefs(mark: bool)
Gets all marked (default) or unmarked Linedefs.
Parameters
- mark:
trueto get all markedLinedefs (default),falseto get all unmarkedLinedefs
Return value
missing
getMarkedSectors(mark: bool)
Gets all marked (default) or unmarked Sectors.
Parameters
- mark:
trueto get all markedSectors (default),falseto get all unmarkedSectors
Return value
missing
getMarkedSidedefs(mark: bool)
Gets all marked (default) or unmarked Sidedefs.
Parameters
- mark:
trueto get all markedSidedefs (default),falseto get all unmarkedSidedefs
Return value
missing
getMarkedThings(mark: bool)
Gets all marked (default) or unmarked Things.
Parameters
- mark:
trueto get all markedThings (default),falseto get all unmarkedThings
Return value
missing
getMarkedVertices(mark: bool)
Gets all marked (default) or unmarked vertices.
Parameters
- mark:
trueto get all marked vertices (default),falseto get all unmarked vertices
Return value
missing
getMultipleNewTags(count: int)
Gets multiple new tags.
Parameters
- count: Number of tags to get
Return value
Array of the new tags
getNewTag(usedtags: int[])
Gets a new tag.
Parameters
- usedtags:
Arrayof tags to skip
Return value
The new tag
getSectors()
Returns an Array of all Sectors in the map.
Return value
Array of Sectors
getSelectedLinedefs(selected: bool)
Gets all selected (default) or unselected Linedefs.
Parameters
- selected:
trueto get all selectedLinedefs,falseto get all unselected ones
Return value
Array of Linedefs
getSelectedOrHighlightedLinedefs()
Gets the currently selected Linedefs or, if no Linedefs are selected, a currently highlightedLinedef`.
Return value
Array of Linedefs
getSelectedOrHighlightedSectors()
Gets the currently selected Sectors or, if no Sectors are selected, a currently highlighted Sector.
Return value
Array of Sectors
getSelectedOrHighlightedThings()
Gets the currently selected Things or, if no Things are selected, a currently highlighted Thing.
Return value
Array of Things
getSelectedOrHighlightedVertices()
Gets the currently selected Vertexs or, if no Vertexs are selected, a currently highlighted Vertex.
Return value
Array of Vertex
getSelectedSectors(selected: bool)
Gets all selected (default) or unselected Sectors.
Parameters
- selected:
trueto get all selectedSectors,falseto get all unselected ones
Return value
Array of Sectors
getSelectedThings(selected: bool)
Gets all selected (default) or unselected Things.
Parameters
- selected:
trueto get all selectedThings,falseto get all unselected ones
Return value
Array of Things
getSelectedVertices(selected: bool)
Gets all selected (default) or unselected vertices.
Parameters
- selected:
trueto get all selected vertices,falseto get all unselected ones
Return value
Array of Vertex
getSidedefs()
Returns an Array of all Sidedefs in the map.
Return value
Array of Sidedefs
getSidedefsFromSelectedLinedefs(selected: bool)
Gets all Sidedefs from the selected Linedefs.
In classic modes this will return both sidedefs of 2-sided lines, in visual mode it will only return the actually selected Sidedef.
Parameters
- selected:
trueto get allSidedefs of all selectedLinedefs,falseto get allSidedefs of all unselectedLinedefs
Return value
Array of Sidedef
Version: 3
getSidedefsFromSelectedOrHighlightedLinedefs()
Gets the Sidedefs of the currently selected Linedefs or, if no Linedefs are selected, the Sidedefs of the currently highlighted Linedef.
In classic modes this will return both sidedefs of 2-sided lines, in visual mode it will only return the actually selected Sidedef.
Return value
Array of Sidedefs
getThings()
Returns an Array of all Things in the map.
Return value
Array of Things
getVertices()
Returns an Array of all Vertex in the map.
Return value
Array of Vertex
invertAllMarks()
Inverts all marks of all map elements.
invertMarkedLinedefs()
Inverts the marked property of all Linedefs.
invertMarkedSectors()
Inverts the marked property of all Sectors.
invertMarkedSidedefs()
Inverts the marked property of all Sidedefs.
invertMarkedThings()
Inverts the marked property of all Things.
invertMarkedVertices()
Inverts the marked property of all vertices.
joinSectors(sectors: Sector[])
Joins Sectors, keeping lines shared by the Sectors. All Sectors will be joined with the first Sector in the array.
Parameters
- sectors:
ArrayofSectors
markSelectedLinedefs(mark: bool)
Marks (default) or unmarks all selected Linedefs.
Parameters
- mark:
trueto mark all selectedLinedefs (default),falseto unmark
markSelectedSectors(mark: bool)
Marks (default) or unmarks all selected Sectors.
Parameters
- mark:
trueto mark all selectedSectors (default),falseto unmark
markSelectedThings(mark: bool)
Marks (default) or unmarks all selected Things.
Parameters
- mark:
trueto mark all selectedThings (default),falseto unmark
markSelectedVertices(mark: bool)
Marks (default) or unmarks all selected vertices.
Parameters
- mark:
trueto mark all selected vertices (default),falseto unmark
mergeSectors(sectors: Sector[])
Merges Sectors, deleting lines shared by the Sectors. All Sectors will be merged into the first Sector in the array.
Parameters
- sectors:
ArrayofSectors
nearestLinedef(pos: object, maxrange: double)
Gets the Linedef that's nearest to the specified position.
Parameters
- pos: Position to check against
- maxrange: Maximum range (optional)
Return value
Nearest Linedef
nearestSidedef(pos: object)
Gets the Sidedef that's nearest to the specified position.
Parameters
- pos: Position to check against
- maxrange: Maximum range (optional)
Return value
Nearest Sidedef
nearestThing(pos: object, maxrange: double)
Gets the Thing that's nearest to the specified position.
Parameters
- pos: Position to check against
- maxrange: Maximum range (optional)
Return value
Nearest Linedef
nearestVertex(pos: object, maxrange: double)
Gets the Vertex that's nearest to the specified position.
Parameters
- pos: Position to check against
- maxrange: Maximum range (optional)
Return value
Nearest Vertex
snapAllToAccuracy(usepreciseposition: bool)
Snaps all vertices and things to the map format accuracy. Call this to ensure the vertices and things are at valid coordinates.
Parameters
- usepreciseposition:
trueif decimal places defined by the map format should be used,falseif no decimal places should be used
snappedToGrid(pos: object)
Returns the given point snapped to the current grid.
Parameters
- pos: Point that should be snapped to the grid
Return value
Snapped position as Vector2D
stitchGeometry(mergemode: MergeGeometryMode)
Stitches marked geometry with non-marked geometry.
Parameters
- mergemode: Mode to merge by as
MergeGeometryMode
Return value
true if successful, false if failed
Enums
Version: 5
MergeGeometryMode
How geometry should be merged when geometry is stitched.
UDB.Map.stitchGeometry(UDB.Map.MergeometryMode.MERGE);
Options
- CLASSIC: Merge vertices only
- MERGE: Merge vertices and lines
- REPLACE: Merge vertices and lines, replacing sector geometry