Skip to content

MapObject

Type

MapObject

The MapObject type is a base type for all map editor objects.

Derived Types

The following types inherit all MapObject properties and functions:

Properties

Property Type Description
index integer The object's index in the map
type integer The object's type (see TYPE_ constants)
typeName string The object type name (eg. Vertex)

Constants

Name Value
TYPE_OBJECT 0
TYPE_VERTEX 1
TYPE_LINE 2
TYPE_SIDE 3
TYPE_SECTOR 4
TYPE_THING 5

Constructors

No Constructors

This type can not be created directly in scripts.

Functions

Regarding MapObject *Property and Set*Property functions

MapObject properties in SLADE generally mirror the properties defined in the UDMF specification. As an example, setting the texturetop string property on a MapSide MapObject will set its upper texture. Note that not all basic UDMF properties are supported for non-UDMF maps.

Overview

Properties

HasProperty(name) -> boolean BoolProperty(name) -> boolean IntProperty(name) -> integer FloatProperty(name) -> float StringProperty(name) -> string SetBoolProperty(name, value) SetIntProperty(name, value) SetFloatProperty(name, value) SetStringProperty(name, value)


HasProperty

Parameters

  • name (string): The name of the property to check

Returns

  • boolean: true if the object has a property matching the given name

BoolProperty

Parameters

  • name (string): The name of the property to get

Returns

  • boolean: The value of the property, or false if no applicable value was found

Notes

If the property doesn't exist in the object, the game configuration is checked for a default value.


IntProperty

Parameters

  • name (string): The name of the property to get

Returns

  • integer: The value of the property, or 0 if no applicable value was found

Notes

If the property doesn't exist in the object, the game configuration is checked for a default value.


FloatProperty

Parameters

  • name (string): The name of the property to get

Returns

  • float: The value of the property, or 0 if no applicable value was found

Notes

If the property doesn't exist in the object, the game configuration is checked for a default value.


StringProperty

Parameters

  • name (string): The name of the property to get

Returns

  • string: The value of the property, or an empty string if no applicable value was found

Notes

If the property doesn't exist in the object, the game configuration is checked for a default value.


SetBoolProperty

Sets the property name to value.

Parameters

  • name (string): The name of the property to set
  • value (boolean): The value to apply

Notes

The property is added if it doesn't already exist.


SetIntProperty

Sets the property name to value.

Parameters

  • name (string): The name of the property to set
  • value (integer): The value to apply

Notes

The property is added if it doesn't already exist.


SetFloatProperty

Sets the property name to value.

Parameters

  • name (string): The name of the property to set
  • value (float): The value to apply

Notes

The property is added if it doesn't already exist.


SetStringProperty

Sets the property name to value.

Parameters

  • name (string): The name of the property to set
  • value (string): The value to apply

Notes

The property is added if it doesn't already exist.