Class TCastleTiledMapData

Unit

Declaration

type TCastleTiledMapData = class(TObject)

Description

Loading and manipulating "Tiled" map files (http://mapeditor.org).

Source: src/scene/castletiledmap_data.inc (line 23).

Hierarchy

  • TObject
  • TCastleTiledMapData

Overview

Nested Classes and Records

Public TAnimation = class(specialize TObjectList<TFrame>)
Public TData = class(TObject)
Public TFrame = class(TObject)
Public TImage = class(TObject)
Public TImageLayer = class(TLayer)
Public TLayer = class(TObject)
Public TObjectGroupLayer = class(TLayer)
Public TProperty = class(TObject)
Public TPropertyList = class(specialize TObjectList<TProperty>)
Public TTerrain = class(TObject)
Public TTile = class(TObject)
Public TTiledObject = class(TObject)
Public TTileset = class(TObject)

Nested Types

Public TCompressionType = (...);
Public TEncodingType = (...);
Public TLayerList = specialize TObjectList<TLayer>;
Public TMapOrientation = (...);
Public TMapRenderOrder = (...);
Public TObjectsDrawOrder = (...);
Public TStaggerAxis = (...);
Public TStaggerIndex = (...);
Public TTerrainTypes = specialize TObjectList<TTerrain>;
Public TTiledObjectList = specialize TObjectList<TTiledObject>;
Public TTiledObjectPrimitive = (...);
Public TTileList = specialize TObjectList<TTile>;
Public TTilesetList = specialize TObjectList<TTileset>;

Methods

Public constructor Create(const Stream: TStream; const ABaseUrl: String); overload;
Public constructor Create(const AUrl: String); overload;
Public destructor Destroy; override;
Public function TilePositionValid(const TilePosition: TVector2Integer): Boolean;
Public function PositionToTile(const Position: TVector2; out TilePosition: TVector2Integer): Boolean;
Public function TileRenderPosition(const TilePosition: TVector2Integer): TVector2;
Public function TileRenderData(const TilePosition: TVector2Integer; const Layer: TLayer; out Tileset: TTileset; out Frame: Integer; out HorizontalFlip, VerticalFlip, DiagonalFlip: Boolean): Boolean;
Public function TileNeighbor(const Tile1, Tile2: TVector2Integer; const CornersAreNeighbors: Boolean): Boolean;

Properties

Public property Layers: TLayerList read FLayers;
Public property Orientation: TMapOrientation read FOrientation;
Public property Properties: TPropertyList read FProperties;
Public property Tilesets: TTilesetList read FTilesets;
Public property Width: Cardinal read FWidth;
Public property Height: Cardinal read FHeight;
Public property TileWidth: Cardinal read FTileWidth;
Public property TileHeight: Cardinal read FTileHeight;
Public property HexSideLength: Cardinal read FHexSideLength;
Public property StaggerAxis: TStaggerAxis read FStaggerAxis;
Public property StaggerIndex: TStaggerIndex read FStaggerIndex;
Public property BackgroundColor: TCastleColor read FBackgroundColor;
Public property RenderOrder: TMapRenderOrder read FRenderOrder;

Description

Nested Types

Public TCompressionType = (...);

This item has no description.

Values
  • ctNone
  • ctGZip
  • ctZLib

Source: src/scene/castletiledmap_data.inc (line 36).

Public TEncodingType = (...);

This item has no description.

Values
  • etNone
  • etBase64
  • etCSV

Source: src/scene/castletiledmap_data.inc (line 36).

Public TLayerList = specialize TObjectList<TLayer>;

List of layers.

Source: src/scene/castletiledmap_data.inc (line 200).

Public TMapOrientation = (...);

This item has no description.

Values
  • moOrthogonal
  • moIsometric
  • moIsometricStaggered
  • moHexagonal

Source: src/scene/castletiledmap_data.inc (line 310).

Public TMapRenderOrder = (...);

This item has no description.

Values
  • mroRightDown
  • mroRightUp
  • mroLeftDown
  • mroLeftUp

Source: src/scene/castletiledmap_data.inc (line 310).

Public TObjectsDrawOrder = (...);

This item has no description.

Values
  • odoIndex
  • odoTopDown

Source: src/scene/castletiledmap_data.inc (line 82).

Public TStaggerAxis = (...);

This item has no description.

Values
  • saX
  • saY

Source: src/scene/castletiledmap_data.inc (line 310).

Public TStaggerIndex = (...);

This item has no description.

Values
  • siOdd
  • siEven

Source: src/scene/castletiledmap_data.inc (line 310).

Public TTerrainTypes = specialize TObjectList<TTerrain>;

This element defines an array of terrain types, which can be referenced from the terrain attribute of the tile element.

Source: src/scene/castletiledmap_data.inc (line 264).

Public TTiledObjectList = specialize TObjectList<TTiledObject>;

This item has no description.

Source: src/scene/castletiledmap_data.inc (line 123).

Public TTiledObjectPrimitive = (...);

This item has no description.

Values
  • topRectangle
  • topPoint
  • topEllipse
  • topPolygon
  • topPolyLine

Source: src/scene/castletiledmap_data.inc (line 82).

Public TTileList = specialize TObjectList<TTile>;

Tiles list.

Source: src/scene/castletiledmap_data.inc (line 251).

Public TTilesetList = specialize TObjectList<TTileset>;

List of tilesets.

Source: src/scene/castletiledmap_data.inc (line 310).

Methods

Public constructor Create(const Stream: TStream; const ABaseUrl: String); overload;

Constructor.

Parameters
AUrl
URL to Tiled (TMX) file.

Source: src/scene/castletiledmap_data.inc (line 384).

Public constructor Create(const AUrl: String); overload;

This item has no description.

Source: src/scene/castletiledmap_data.inc (line 385).

Public destructor Destroy; override;

This item has no description.

Source: src/scene/castletiledmap_data.inc (line 386).

Public function TilePositionValid(const TilePosition: TVector2Integer): Boolean;

Is the given tile number valid. Valid map tiles are from (0, 0) (lower-left) to (Width - 1, Height - 1) (upper-right).

Source: src/scene/castletiledmap_data.inc (line 391).

Public function PositionToTile(const Position: TVector2; out TilePosition: TVector2Integer): Boolean;

Detect tile under given position.

Input Position is in local map coordinates.

Output TilePosition must is a tile coordinate, where map bottom-left corner is (0, 0).

This method returns False if the position is outside of the map. Valid map tiles are defined as by TilePositionValid.

Note: Regardless of the result (True or False), the TilePosition is reliably defined and set. It is just outside of the map range if the result is False. If you don't care about it (that is, you want to accept even positions that are outside of map range) that you're free to use TilePosition for whatever calculations.

Source: src/scene/castletiledmap_data.inc (line 409).

Public function TileRenderPosition(const TilePosition: TVector2Integer): TVector2;

Left-bottom corner where the given tile should be rendered.

Source: src/scene/castletiledmap_data.inc (line 413).

Public function TileRenderData(const TilePosition: TVector2Integer; const Layer: TLayer; out Tileset: TTileset; out Frame: Integer; out HorizontalFlip, VerticalFlip, DiagonalFlip: Boolean): Boolean;

Information about which image (and how) should be displayed at given map position.

Source: src/scene/castletiledmap_data.inc (line 416).

Public function TileNeighbor(const Tile1, Tile2: TVector2Integer; const CornersAreNeighbors: Boolean): Boolean;

Are the two given tiles neighbors. Takes into account map Orientation, so it works for hexagonal, orthogonal etc. maps.

Source: src/scene/castletiledmap_data.inc (line 425).

Properties

Public property Layers: TLayerList read FLayers;

This item has no description.

Source: src/scene/castletiledmap_data.inc (line 353).

Public property Orientation: TMapOrientation read FOrientation;

Map orientation.

Source: src/scene/castletiledmap_data.inc (line 355).

Public property Properties: TPropertyList read FProperties;

This item has no description.

Source: src/scene/castletiledmap_data.inc (line 356).

Public property Tilesets: TTilesetList read FTilesets;

This item has no description.

Source: src/scene/castletiledmap_data.inc (line 357).

Public property Width: Cardinal read FWidth;

The map width in tiles.

Source: src/scene/castletiledmap_data.inc (line 359).

Public property Height: Cardinal read FHeight;

The map height in tiles.

Source: src/scene/castletiledmap_data.inc (line 361).

Public property TileWidth: Cardinal read FTileWidth;

The width of a tile.

Source: src/scene/castletiledmap_data.inc (line 363).

Public property TileHeight: Cardinal read FTileHeight;

The height of a tile.

Source: src/scene/castletiledmap_data.inc (line 365).

Public property HexSideLength: Cardinal read FHexSideLength;

The height of a hexagon side. Only relevant when Orientation = moHexagonal.

Source: src/scene/castletiledmap_data.inc (line 368).

Public property StaggerAxis: TStaggerAxis read FStaggerAxis;

Only relevant when Orientation = moIsometricStaggered or moHexagonal.

Source: src/scene/castletiledmap_data.inc (line 370).

Public property StaggerIndex: TStaggerIndex read FStaggerIndex;

Which rows are shifted by 1. Only relevant when Orientation = moIsometricStaggered or moHexagonal.

Source: src/scene/castletiledmap_data.inc (line 373).

Public property BackgroundColor: TCastleColor read FBackgroundColor;

Background color of the map. It may be unset in Tiled, which results in transparent color here.

Source: src/scene/castletiledmap_data.inc (line 376).

Public property RenderOrder: TMapRenderOrder read FRenderOrder;

The order in which tiles on tile layers are rendered. Valid values are right-down (the default), right-up, left-down and left-up. In all cases, the map is drawn row-by-row. (since 0.10, but only supported for orthogonal maps at the moment)

Source: src/scene/castletiledmap_data.inc (line 381).


Generated by PasDoc 0.17.0.snapshot.