Categories > Board > rex_tmx_importer_v2

Introduction

Retrieve or create tiles by tmx string which is the exported file of tile map editor.

Links


Categories > Board > rex_tmx_importer_v2IntroductionLinksDependenceUsageImport tmx fileOffset of tilesCreate tilesSingle tick modeMultiple ticks modeRelease tmx objectObject layerRetrieve propertiesRetrieve propertiesRetrieve layersRetrieve tiles at logic X,YConfigure board objectFilling tilemapOfficial save/load

Dependence

Usage

Sample capx

Import tmx file

Calls Action:Import tmx to import tmx string with a parser.

Offset of tiles

The offset of tiles is defined in

It affects the created tiles (Action:Create tiles, or Action:Create tiles in a duration), and Expression:PhysicalX, Expression:PhysicalY.

Create tiles

Calls one of these action after importing tmx string (Action:Import tmx)

Single tick mode

Action:Retrieve tile arrayFor each cell----+Condition:On each tile cellSystem action:Createat (Expression:PhysicalX , Expression:PhysicalY)layer Expression:LayerNameMore propreties:Expression:Frame,Expression:IsMirrored, Expression:IsFlipped,Expression:TileProp,....

Multiple ticks mode

Action:Retrieve tile array in a duration,Action:Create tiles in a durationEvery tick of processing:----+Condition:On retrieving durationExpression:RetrievingPercentOn completed:----+Condition:On retrieving finished

Release tmx object

Calls Action:Release tmx object to release parsing result from memory.

DO NOT release tmx object during retrieving processing (Action:Retrieve tile array in a duration, Action:Create tiles in a duration)

Object layer

It retrieves object layers under Condition:On each object , get properties of object by

Action:Retrieve tile array,Action:Create tiles,Action:Retrieve tile array in a duration,Action:Create tiles in a durationFor each object----+Condition:On each objectExpression:ObjectName, Expression:ObjectType(Expression:ObjectX , Expression:ObjectY)Expression:ObjectWidth, Expression:ObjectHeightExpression:ObjectProp

Retrieve properties

Retrieve properties

Retrieve layers

Condition:For each layer, to retrieve layers,

Retrieve tiles at logic X,Y

Sample capx Call Condition:For each tile at logic XY to get properties of tiles at logic X,Y, to create a part of tiles in a specific logic position.


Configure board object

Configure these objects to store tiles in rex_board object.

Action of boardExpression of TMX
Action:Set board widthExpression:MapWidth
Action:Set board heightExpression:MapHeight
Action of squareTxExpression of TMX
Action:Set orientation by numberExpression:IsIsometric
Action:Set cell sizeExpression:TileWidth, Expression:TileHeight
Action of hexTxExpression of TMX
Action:Set layout by numberExpression:IsUp2Down, Expression:IsIndent
Action:Set cell sizeExpression:TileWidth, Expression:TileHeight

Filling tilemap

Sample capx Calls Action:Reset tilemap to resize the official tilemap object and fill tile ID with a tmx layer.


Official save/load

Sample capx This plugin support official save/load.