LdtkAutoLayerRuleDefinition
This complex section isn't meant to be used by game devs according to LDtk documentation, but Ceramic auto-tiling rules can be generated from these so they may still be useful for us if we want to edit a map in game while still fully working auto-layer rules from LDtk. The use of this is opt-in. Default map loading is using already resolved tiles.
Instance Members
If false, the rule effect isn't applied, and no tiles are generated.
When true, the rule will prevent other rules to be applied in the same cell if it matches (true by default).
Chances for this rule to be applied (0 to 1)
Checker mode
If true, allow rule to be matched by flipping its pattern horizontally
If true, allow rule to be matched by flipping its pattern vertically
Default IntGrid value when checking cells outside of level bounds
Rule pattern (size x size). Each cell holds its first condition:
0 = ignored, +v = IntGrid value v required, -v = value v forbidden (see patternAlt for extra conditions).
Extra conditions per pattern cell (same size and order as pattern, same value encoding).
Each entry is an empty array when the cell has a single condition.
A cell matches if (it has no required value, or the cell value is one of the required values)
AND (the cell value is none of the forbidden values).
(added in LDtk 1.5.4)
If true, enable Perlin filtering to only apply rule on specific random area
X pivot of a tile stamp (0-1)
Y pivot of a tile stamp (0-1)
Pattern width & height. Should only be 1,3,5 or 7.
Array of all the tile IDs, flattened from tileRectsIds.
Deprecated in LDtk 1.5.0 in favor of tileRectsIds, but still filled for convenience.
Array containing all the possible tile IDs rectangles (picked randomly).
Each entry is a list of tile IDs: a single tile in Single tile mode, or a rectangle of tiles in Stamp tile mode.
(added in LDtk 1.5.0, replaces tileIds)
If true, the tile(s) rendered by this rule can be randomly flipped horizontally.
This doesn't affect the pattern matching (see flipX for that).
The resulting flips are already baked in the autoLayerTiles flip bits.
(added in LDtk 1.5.4)
If true, the tile(s) rendered by this rule can be randomly flipped vertically.
This doesn't affect the pattern matching (see flipY for that).
The resulting flips are already baked in the autoLayerTiles flip bits.
(added in LDtk 1.5.4)
Defines how tileRectsIds array is used
Unique Int identifier
X cell coord modulo
X cell start offset
Y cell coord modulo
Y cell start offset
This rule as used by the LDtk rule engine (ldtk.rules.RuleEngine), to recompute auto-layer tiles at runtime.
| Returns |
|---|
| String |
| Name | Type | Default |
|---|---|---|
json |
haxe.DynamicAccess<Dynamic> | (optional) |