MapObject

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

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.

Derived Types

The following types inherit all MapObject properties and functions:

Properties

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

Constructors

No Constructors

This type can not be created directly in scripts.

Functions

hasProperty

Parameters

  • string name: The name of the property to check

Returns boolean

Returns true if the object has a property matching the given name


boolProperty

Parameters

  • string name: The name of the property to get

Returns boolean

Returns the boolean value of the property matching the given name. If the property doesn't exist, the game configuration is checked for a default value. Otherwise, returns false.


intProperty

Parameters

  • string name: The name of the property to get

Returns number

Returns the integer number value of the property matching the given name. If the property doesn't exist, the game configuration is checked for a default value. Otherwise, returns 0.


floatProperty

Parameters

  • string name: The name of the property to get

Returns number

Returns the floating point number value of the property matching the given name. If the property doesn't exist, the game configuration is checked for a default value. Otherwise, returns 0.


stringProperty

Parameters

  • string name: The name of the property to get

Returns string

Returns the string value of the property matching the given name. If the property doesn't exist, the game configuration is checked for a default value. Otherwise, returns an empty string.


setBoolProperty

Parameters

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

Sets the property name to value. The property is created if it doesn't already exist.


setIntProperty

Parameters

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

Sets the property name to value. The property is created if it doesn't already exist.


setFloatProperty

Parameters

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

Sets the property name to value. The property is created if it doesn't already exist.


setStringProperty

Parameters

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

Sets the property name to value. The property is created if it doesn't already exist.