Class TTiledMap
Unit
Declaration
type TTiledMap = class(TObject)
Description
Loading and manipulating "Tiled" map files (http://mapeditor.org).
Hierarchy
- TObject
- TTiledMap
Overview
Nested Classes and Records
TAnimation = class(specialize TObjectList<TFrame>) |
|
TData = class(TObject) |
|
TFrame = class(TObject) |
|
TImage = class(TObject) |
|
TImageLayer = class(TLayer) |
|
TLayer = class(TObject) |
|
TObjectGroupLayer = class(TLayer) |
|
TProperty = class(TObject) |
|
TPropertyList = class(specialize TObjectList<TProperty>) |
|
TTerrain = class(TObject) |
|
TTile = class(TObject) |
|
TTiledObject = class(TObject) |
|
TTileset = class(TObject) |
Nested Types
TCompressionType = (...); |
|
TEncodingType = (...); |
|
TLayerList = specialize TObjectList<TLayer>; |
|
TMapOrientation = (...); |
|
TMapRenderOrder = (...); |
|
TObjectsDrawOrder = (...); |
|
TStaggerAxis = (...); |
|
TStaggerIndex = (...); |
|
TTerrainTypes = specialize TObjectList<TTerrain>; |
|
TTiledObjectList = specialize TObjectList<TTiledObject>; |
|
TTiledObjectPrimitive = (...); |
|
TTileList = specialize TObjectList<TTile>; |
|
TTilesetList = specialize TObjectList<TTileset>; |
Methods
constructor Create(const Stream: TStream; const ABaseUrl: String); overload; |
|
constructor Create(const AURL: string); overload; |
|
destructor Destroy; override; |
|
function TilePositionValid(const TilePosition: TVector2Integer): Boolean; |
|
function PositionToTile(const Position: TVector2; out TilePosition: TVector2Integer): Boolean; |
|
function TileRenderPosition(const TilePosition: TVector2Integer): TVector2; |
|
function TileRenderData(const TilePosition: TVector2Integer; const Layer: TTiledMap.TLayer; out Tileset: TTiledMap.TTileset; out Frame: Integer; out HorizontalFlip, VerticalFlip, DiagonalFlip: Boolean): Boolean; |
|
function TileNeighbor(const Tile1, Tile2: TVector2Integer; const CornersAreNeighbors: Boolean): Boolean; |
Properties
property Layers: TLayerList read FLayers; |
|
property Orientation: TMapOrientation read FOrientation; |
|
property Properties: TPropertyList read FProperties; |
|
property Tilesets: TTilesetList read FTilesets; |
|
property Width: Cardinal read FWidth; |
|
property Height: Cardinal read FHeight; |
|
property TileWidth: Cardinal read FTileWidth; |
|
property TileHeight: Cardinal read FTileHeight; |
|
property HexSideLength: Cardinal read FHexSideLength; |
|
property StaggerAxis: TStaggerAxis read FStaggerAxis; |
|
property StaggerIndex: TStaggerIndex read FStaggerIndex; |
|
property BackgroundColor: TCastleColor read FBackgroundColor; |
|
property RenderOrder: TMapRenderOrder read FRenderOrder; |
Description
Nested Types
TCompressionType = (...); |
|
Values
|
TEncodingType = (...); |
|
Values
|
TLayerList = specialize TObjectList<TLayer>; |
|
List of layers. |
TMapOrientation = (...); |
|
Values
|
TMapRenderOrder = (...); |
|
Values
|
TObjectsDrawOrder = (...); |
|
Values
|
TStaggerAxis = (...); |
|
Values
|
TStaggerIndex = (...); |
|
Values
|
TTerrainTypes = specialize TObjectList<TTerrain>; |
|
This element defines an array of terrain types, which can be referenced from the terrain attribute of the tile element. |
TTiledObjectList = specialize TObjectList<TTiledObject>; |
|
TTiledObjectPrimitive = (...); |
|
Values
|
TTileList = specialize TObjectList<TTile>; |
|
Tiles list. |
TTilesetList = specialize TObjectList<TTileset>; |
|
List of tilesets. |
Methods
constructor Create(const Stream: TStream; const ABaseUrl: String); overload; |
|
Constructor. Parameters
|
constructor Create(const AURL: string); overload; |
|
destructor Destroy; override; |
|
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). |
function PositionToTile(const Position: TVector2; out TilePosition: TVector2Integer): Boolean; |
|
Detect tile under given position. Similar to TCastleTiledMapControl.PositionToTile. Given TilePosition must be in local map coordinates, where each map piece has size (TileWidth, TileHeight), and map bottom-left corner is in (0, 0). This method returns |
function TileRenderPosition(const TilePosition: TVector2Integer): TVector2; |
|
Left-bottom corner where the given tile should be rendered. |
function TileRenderData(const TilePosition: TVector2Integer; const Layer: TTiledMap.TLayer; out Tileset: TTiledMap.TTileset; out Frame: Integer; out HorizontalFlip, VerticalFlip, DiagonalFlip: Boolean): Boolean; |
|
Information about which image (and how) should be displayed at given map position. |
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. |
Properties
property Layers: TLayerList read FLayers; |
|
property Orientation: TMapOrientation read FOrientation; |
|
Map orientation. |
property Properties: TPropertyList read FProperties; |
|
property Tilesets: TTilesetList read FTilesets; |
|
property Width: Cardinal read FWidth; |
|
The map width in tiles. |
property Height: Cardinal read FHeight; |
|
The map height in tiles. |
property TileWidth: Cardinal read FTileWidth; |
|
The width of a tile. |
property TileHeight: Cardinal read FTileHeight; |
|
The height of a tile. |
property HexSideLength: Cardinal read FHexSideLength; |
|
The height of a hexagon side. Only relevant when Orientation = moHexagonal. |
property StaggerAxis: TStaggerAxis read FStaggerAxis; |
|
Only relevant when Orientation = moIsometricStaggered or moHexagonal. |
property StaggerIndex: TStaggerIndex read FStaggerIndex; |
|
Which rows are shifted by 1. Only relevant when Orientation = moIsometricStaggered or moHexagonal. |
property BackgroundColor: TCastleColor read FBackgroundColor; |
|
Background color of the map. It may be unset in Tiled, which results in transparent color here. |
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) |
Generated by PasDoc 0.16.0.