Tools
format.tmx.Tools (Class)
...
@author Yanrishatum
Static Members
resolveOTExternalTile(map: TmxMap, ?mapPath: String): Void
Resolves OTExternalTile into OTTile.
Only works if templates and tilesets were resolved and their paths are relative.
Name |
Type |
Default |
Description |
map |
TmxMap |
|
|
mapPath |
String |
(optional) |
Optional local path to the map file used for accurate TSX path resolving when comparing tilesets. |
Returns linear array of layers removing all nested groups.
IMPORTANT! This function will apply group offset/opacity/visibility values to nested layers, don't use it if you need to keep them unchanged.
Propagates properties from Object Type Template for specific object
Propagates tile properties of tile object in tileset to specific object.
Name |
Type |
Description |
obj |
TmxObject |
Object to propagate tile data to. |
map |
TmxMap |
@param gid Global tile ID from which to take properties. |
gid |
Int |
Global tile ID from which to take properties. |
propagateObjectTypes(map: TmxMap, types: Map, ?propagateObjectLayers: Bool = true, ?propagateTileColliders: Bool = true): Void
Propagates properties from Object Type templates to all objects on the map.
Name |
Type |
Default |
Description |
map |
TmxMap |
|
Map to which properties should propagate. |
types |
Map |
|
List of Object Type Templates by names. |
propagateObjectLayers |
Bool |
true |
Should propagate to objects on ObjectLayers? |
propagateTileColliders |
Bool |
true |
Should propagate to objects in collisions of tile objects? |
Returns Tile settings for given tile global ID.
Returns tileset in which given global ID present.
Returns tileset index in which given global ID present.
Sets x
and y
values to output
relative to tile position on source image of tileset.
Note: Currently do not supports non-zero margin and spacing values.
Shifts origin of objects from bottom-left edge to top-left edge.
Left out for compatibility
Shifts origin of objects from bottom-left edge to top-left edge.
Returns amount of tiles in one line in given tileset. Use it for UV calculation.
Returns amount of tiles in one column in given tileset. UV calculation.
Returns total amount of tiles in tileset.
Returns visual tile position based on the map parameters and optionally on tileset sizes.
Name |
Type |
Default |
Description |
map |
TmxMap |
|
|
tx |
Int |
|
|
ty |
Int |
|
|
tileset |
TmxTileset |
(optional) |
Optional tileset reference. If present, it's tile sizes will be used for position calculation. |
lid |
Int |
(optional) |
Optional local tile ID on tileset. Required for imageset tilesets. |
Private Members
resolveOTExternalTileInternal(map: TmxMap, layer: Anonymous, mapPath: String, paths: Array<String>): Void
propagateTilePropertiesLayer(map: TmxMap, layer: Anonymous): Void
Name |
Type |
map |
TmxMap |
layer |
Anonymous |