Options
All
  • Public
  • Public/Protected
  • All
V1.7
  • V1.6
  • V1.7
Menu

Class SubTexture

Describes a sub-texture, which is a texture packed within a larger texture.

Hierarchy

  • SubTexture

Index

Constructors

constructor

  • new SubTexture(a_name?: string, a_sheetIndex?: number, a_coordsMin?: [number, number] | Float32Array, a_coordsMax?: [number, number] | Float32Array, a_startXY?: [number, number] | Float32Array, a_size?: [number, number] | Float32Array, a_pivotPoint?: [number, number] | Float32Array, a_rotation?: number): SubTexture
  • Parameters

    • Optional a_name: string
    • Optional a_sheetIndex: number
    • Optional a_coordsMin: [number, number] | Float32Array
    • Optional a_coordsMax: [number, number] | Float32Array
    • Optional a_startXY: [number, number] | Float32Array
    • Optional a_size: [number, number] | Float32Array
    • Optional a_pivotPoint: [number, number] | Float32Array
    • Optional a_rotation: number

    Returns SubTexture

Properties

coordsMax

coordsMax: [number, number]

Max coordinates of the sub-texture; (x, y) both between [0, 1].

coordsMin

coordsMin: [number, number]

Min coordinates of the sub-texture; (x, y) both between [0, 1].

name

name: string

Unique name of the sub-texture; often a source-image (e.g., "Tex1.png").

pivotPoint

pivotPoint: [number, number]

Position inside the sub-texture used as the center for rotation.

rotation

rotation: number

Rotation angle in degrees wrt the main texture (e.g., to save space).

sheetIndex

sheetIndex: number

Index of the sheet in the muli-pack that contains the sub-texture.

size

size: [number, number]

The size of the sub texture in pixels.

startXY

startXY: [number, number]

The offest to the starting pixel in the source image.

Static NONE

Sentinal value representing no sub-texture.

value = SubTexture()

Methods

isNone

  • isNone(): boolean

toString

  • toString(): string

Generated using TypeDoc