FlatTileBuffer

ldtk.rules.FlatTileBuffer (Class)
Implements: AutoTileSink

Flat, reusable tile buffer for runtime use: STRIDE ints per tile, no object per tile. Layout per tile: ruleUid, coordId, tid, flips, x, y, srcX, srcY, alpha*4096. Tiles are stored rule by rule, in the order they were produced; segment* accessors give the range of each rule. The buffer keeps its capacity between reset() calls.

Static Members

STRIDE: Int

Instance Members

data: Array<Int>

length: Int

Number of ints in use


tileCount: Int

segmentCount: Int

reset(): Void

beginRule(ruleUid: Int): Void
Name Type
ruleUid Int

add(coordId: Int, x: Int, y: Int, srcX: Int, srcY: Int, tid: Int, flips: Int, a: Float): Void
Name Type
coordId Int
x Int
y Int
srcX Int
srcY Int
tid Int
flips Int
a Float

getSegmentRuleUid(seg: Int): Int
Name Type
seg Int
Returns
Int

getSegmentStart(seg: Int): Int

First int index of the segment

Name Type
seg Int
Returns
Int

getSegmentEnd(seg: Int): Int

Int index right after the segment

Name Type
seg Int
Returns
Int

tileRuleUid(t: Int): Int
Name Type
t Int
Returns
Int

tileCoordId(t: Int): Int
Name Type
t Int
Returns
Int

tileId(t: Int): Int
Name Type
t Int
Returns
Int

tileFlips(t: Int): Int
Name Type
t Int
Returns
Int

tileX(t: Int): Int
Name Type
t Int
Returns
Int

tileY(t: Int): Int
Name Type
t Int
Returns
Int

tileSrcX(t: Int): Int
Name Type
t Int
Returns
Int

tileSrcY(t: Int): Int
Name Type
t Int
Returns
Int

tileAlpha4096(t: Int): Int
Name Type
t Int
Returns
Int

new(): Void

Private Members

segRuleUid: Array<Int>

segStart: Array<Int>

curRuleUid: Int