Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Session

Provides access to session-specific settings. The session stores per-project preferences like last-used tile sizes, open files, and file states.

Values are accessed by their string key (e.g. "map.tileWidth").

Known Session Properties

Key Type Default Description
"map.orientation" number (Map.Orientation) Map.Orthogonal Last used map orientation
"map.layerDataFormat" number (Map.LayerDataFormat) Map.CSV Last used layer data format
"map.renderOrder" number (Map.RenderOrder) Map.RightDown Last used render order
"map.fixedSize" boolean true Whether new maps use a fixed size
"map.width" number 30 Last used map width (in tiles)
"map.height" number 20 Last used map height (in tiles)
"map.tileWidth" number 32 Last used tile width (in pixels)
"map.tileHeight" number 32 Last used tile height (in pixels)
"map.lastUsedFormat" string "" Last used map format
"map.lastUsedExportFilter" string "" Last used map export filter
"tileset.type" number 0 Last used tileset type
"tileset.embedInMap" boolean false Whether to embed tileset in map
"tileset.useTransparentColor" boolean false Whether to use a transparent color
"tileset.transparentColor" color magenta Transparent color for tilesets
"tileset.tileSize" size {width: 32, height: 32} Last used tileset tile size
"tileset.spacing" number 0 Last used tileset spacing
"tileset.margin" number 0 Last used tileset margin
"tileset.lastUsedFilter" string "" Last used tileset file filter
"tileset.lastUsedFormat" string "" Last used tileset format
"resizeMap.removeObjects" boolean true Remove objects when resizing
"exportAsImage.visibleLayersOnly" boolean true Export only visible layers
"exportAsImage.useCurrentScale" boolean false Use current scale for export
"exportAsImage.drawTileGrid" boolean false Draw tile grid in export
"exportAsImage.drawObjectLabels" boolean false Draw object labels in export
"exportAsImage.includeBackgroundColor" boolean false Include background color in export
"automapping.whileDrawing" boolean false Automap while drawing
"mapScene.enableWorlds" boolean true Enable worlds in map scene
"textEdit.monospace" boolean true Use monospace font in text editor
"frame.defaultDuration" number 100 Default animation frame duration
"console.history" string[] [] Console command history
"property.type" string "string" Last used property type
"file.lastUsedOpenFilter" string "" Last used file open filter
"loadedWorlds" string[] [] List of currently loaded world files
"lastUsedTilesetExportFilter" string "" Last used tileset export filter
"stampsFolder" string "<dataDir>/stamps" Directory for tile stamps
since

1.12

Hierarchy

  • Session

Index

Properties

Readonly fileName

fileName: string

Path to the current session file.

Methods

fileState

  • fileState(fileName: string): {}
  • Returns the per-file state for the given file name.

get

  • get(key: string, defaultValue?: any): any
  • Returns the session value for the given key, or defaultValue if the key is not set.

isSet

  • isSet(key: string): boolean
  • Returns whether the given key is present in the session.

set

  • set(key: string, value: any): void
  • Sets the session value for the given key.

setFileState

  • setFileState(fileName: string, fileState: {}): void
  • Sets the per-file state for the given file name.

    Warning: This replaces the entire per-file state for the given file. To set only a single value, use setFileStateValue instead.

setFileStateValue

  • setFileStateValue(fileName: string, name: string, value: any): void
  • Sets a single value in the per-file state for the given file name.

Generated using TypeDoc