Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TiledObject

The base of most data types in Tiled. Provides the ability to associate custom properties with the data.

Hierarchy

Index

Constructors

constructor

Properties

Readonly asset

asset: Asset

The asset this object is part of, or null.

Readonly readOnly

readOnly: boolean

Whether the object is read-only.

Methods

properties

  • Returns all custom properties set on this object.

    Modifications to the properties will not affect the original object. Does not include inherited values (see resolvedProperties).

property

  • Returns the value of the custom property with the given name, or undefined if no such property is set on the object. Does not include inherited values (see resolvedProperty).

    file properties are returned as FilePath.

    object properties are returned as MapObject when possible, or ObjectRef when the object could not be found.

removeProperty

  • removeProperty(name: string): void
  • Removes the custom property with the given name.

resolvedProperties

  • Returns all custom properties set on this object. Modifications to the properties will not affect the original object. Includes values inherited from object types, templates and tiles where applicable.

resolvedProperty

  • Returns the value of the custom property with the given name, or undefined if no such property is set. Includes values inherited from object types, templates and tiles where applicable.

setProperties

  • Replaces all currently set custom properties with a new set of properties.

setProperty

  • Sets the value of the custom property with the given name. Supported types are bool, number, string, FilePath, ObjectRef and MapObject.

    When setting a number, the property type will be set to either int or float, depending on whether it is a whole number.

    note

    Support for setting color properties is currently missing.

Generated using TypeDoc