QuadColumnTexture

A texture drawn by BGE.QuadColumnDrawer, with its columns and rows (1 texel, or a power-of-two slab of texels, wide) cut as roRegions on first use and kept. Rows are drawn rotated a quarter turn, so no transposed copy of the texture is needed. Share one per texture (an atlas frame is its own texture): Renderer.getQuadColumnTexture() caches them by id.

Properties

  • id (string)
  • x (integer) — the texture's region within its bitmap
  • y (integer)
  • width (integer)
  • height (integer)
  • canMirror (boolean) — Whether columns seen from behind may draw from a flipped copy (see getMirrored()).

Constructor

new QuadColumnTexture( region: roRegion, id?: string, ): QuadColumnTexture

Parameters

  • region (roRegion) — the texture
  • id (string, optional, default: "\"\"")

Instance Methods

hasRect(region: roRegion): boolean

Whether this was cut from region's rect (its bitmap can't be compared).

Parameters

  • region (roRegion)

Returns

  • boolean

getColumn(u: integer): roRegion

Column u, 1 texel wide, anchored at its bottom (texel v = height) so it draws upward.

Parameters

  • u (integer)

Returns

  • roRegion

getRow(v: integer): roRegion

Row v, 1 texel tall, anchored at its right end (texel u = width) and bottom, so drawn turned a quarter clockwise it runs from u = width up to u = 0.

Parameters

  • v (integer)

Returns

  • roRegion

getBitmap(): roBitmap

Returns

  • roBitmap — the bitmap the texture is in, at (x, y)

getColumnSlabs(stepLog2: integer): Array.<roRegion>

Columns stepLog2 (log2 of their width) texels wide, from u = 0; the last may be narrower. Anchored like getColumn().

Parameters

  • stepLog2 (integer)

Returns

  • Array.<roRegion>

getRowSlabs(stepLog2: integer): Array.<roRegion>

Rows stepLog2 (log2 of their height) texels tall, from v = 0; the last may be shorter. Anchored like getRow().

Parameters

  • stepLog2 (integer)

Returns

  • Array.<roRegion>

getPart( u: integer, v: integer, width: integer, height: integer, ): BGE.QuadColumnTexture

A texture of part of this one, for a partial tile (see QuadColumnDrawer.drawTiledTo()). Kept, so its cuts are too.

Parameters

  • u (integer) — left texel
  • v (integer) — top texel
  • width (integer)
  • height (integer)

Returns

getRange( useRows: boolean, first: integer, count: integer, ): roRegion

Columns (or with useRows, rows) first to first + count - 1 as one region, anchored like a slab: for a slab cut short by a partial repeat. Kept.

Parameters

  • useRows (boolean)
  • first (integer)
  • count (integer)

Returns

  • roRegion

getMirrored(useRows: boolean): BGE.QuadColumnTexture

A copy flipped left to right (or with useRows, top to bottom), made on first use and kept: its slabs draw unmirrored where this one's would have to be mirrored, which Roku can't do rotated. Texel u (or v) here is width - 1 - u there.

Parameters

  • useRows (boolean)

Returns

setParent(parent: object, u: integer, v: integer): void

Makes this a part of parent at texel (u, v), so it mirrors from the parent's copy.

Parameters

  • parent (object) — a BGE.QuadColumnTexture
  • u (integer)
  • v (integer)

Returns

  • void