Class TCastleTiledMap
Unit
Declaration
type TCastleTiledMap = class(TCastleTransform)
Description
Display a map created in Tiled in a viewport. See https://castle-engine.io/tiled_maps for a documentation.
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleTransform
- TCastleTiledMap
Overview
Nested Types
TLayerIndex = 0..30; |
|
TLayers = set of TLayerIndex; |
Fields
nested const AllLayers = [Low(TLayerIndex)..High(TLayerIndex)]; |
Methods
function InternalBuildNodeInside: TObject; override; |
|
constructor Create(AOwner: TComponent); override; |
|
destructor Destroy; override; |
|
procedure BeforeDestruction; override; |
|
function PropertySections(const PropertyName: String): TPropertySections; override; |
|
procedure PlayAnimations; |
|
procedure StopAnimations(const ResetAnimations: Boolean); |
|
function HasAnimations: Boolean; |
|
function TileRectangle(const TilePosition: TVector2Integer; const TilesetIndex: Cardinal = 0): TFloatRectangle; |
Properties
property Data: TCastleTiledMapData read FData; |
|
property Map: TCastleTiledMapData read FData; deprecated 'use Data'; |
|
property Url: String read FUrl write SetUrl; |
|
property SmoothScaling: Boolean read FSmoothScaling write SetSmoothScaling default false; |
|
property SmoothScalingSafeBorder: Boolean read FSmoothScalingSafeBorder write SetSmoothScalingSafeBorder
default false; |
|
property ForceTilesetSpacing: Boolean read FForceTilesetSpacing write SetForceTilesetSpacing default false; |
|
property Layers: TLayers read FLayers write SetLayers default AllLayers; |
Description
Nested Types
TLayerIndex = 0..30; |
|
Layer index that can be used with Layers. |
TLayers = set of TLayerIndex; |
|
Type for Layers, set of visible layers. |
Fields
nested const AllLayers = [Low(TLayerIndex)..High(TLayerIndex)]; |
|
Indicates that all Layers should be visible. |
Methods
function InternalBuildNodeInside: TObject; override; |
|
This item has no description. Showing description inherited from TCastleTransform.InternalBuildNodeInside.
Helper for InternalBuildNode. Result must be TAbstractChildNode or |
constructor Create(AOwner: TComponent); override; |
|
This item has no description. |
destructor Destroy; override; |
|
This item has no description. |
procedure BeforeDestruction; override; |
|
This item has no description. |
function PropertySections(const PropertyName: String): TPropertySections; override; |
|
This item has no description. Showing description inherited from TCastleComponent.PropertySections. Section where to show property in the editor. |
procedure PlayAnimations; |
|
This item has no description. |
procedure StopAnimations(const ResetAnimations: Boolean); |
|
This item has no description. |
function HasAnimations: Boolean; |
|
This item has no description. |
function TileRectangle(const TilePosition: TVector2Integer; const TilesetIndex: Cardinal = 0): TFloatRectangle; |
|
Rectangle coordinates where a tile at given TilePosition would be rendered on the map. This doesn't check whether TilePosition is within map range – any coordinates (negative, or larger than map size) are allowed. |
Properties
property Data: TCastleTiledMapData read FData; |
|
Currently loaded map (from Url), if any. |
property Map: TCastleTiledMapData read FData; deprecated 'use Data'; |
|
Warning: this symbol is deprecated: use Data This item has no description. |
property Url: String read FUrl write SetUrl; |
|
URL (or just filename) of the Tiled map file (TMX). Note that loading new map from new URL automatically starts animations. You can stop them with StopAnimations. |
property SmoothScaling: Boolean read FSmoothScaling write SetSmoothScaling default false; |
|
How are images scaled. Beware that using |
property SmoothScalingSafeBorder: Boolean read FSmoothScalingSafeBorder write SetSmoothScalingSafeBorder
default false; |
|
In case of SmoothScaling, prevent the color outside of rendered frame from creeping in, by stretching the rendered frame a bit. See TSprite.SmoothScalingSafeBorder. It is better to prepare the sprite (tileset) images with some spacing between tiles, and alpha bleeding instead of using this property. This property workarounds the fact that some sprite (tileset) images lack proper spacing and color bleeding, but it distorts the image a bit, so it's no longer pixel-perfect. Note that changing this when map is loaded reloads it, and automatically starts animations. You can stop them with StopAnimations. See also ForceTilesetSpacing that workarounds artifacts with SmoothScaling in a different way, by adding spacing in the tileset texture, which makes this trick ( See also
|
property ForceTilesetSpacing: Boolean read FForceTilesetSpacing write SetForceTilesetSpacing default false; |
|
Use a modified version of the tileset image, with a proper space between each tile in the texture (1-pixel size border around each tile, effectively 2-pixel wide spacing between each tile). Makes sense to be used only with SmoothScaling = See also SmoothScalingSafeBorder that workarounds artifacts with SmoothScaling in a different way, by changing texture coordinates such that this spacing is not necessary. Do not use both SmoothScalingSafeBorder and Note that changing this when map is loaded reloads it, and automatically starts animations. You can stop them with StopAnimations. See also
|
property Layers: TLayers read FLayers write SetLayers default AllLayers; |
|
Layers to include when loading this map. Note that changing this when map is loaded reloads it, and automatically starts animations. You can stop them with StopAnimations. TODO: There is an alternative way to hide/show layers: you can read/write |
Generated by PasDoc 0.16.0-snapshot.