SubTexture

lumin.multipack. SubTexture

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

Constructor

new SubTexture(a_nameopt, a_sheetIndexopt, a_coordsMinopt, a_coordsMaxopt, a_startXYopt, a_sizeopt, a_pivotPointopt, a_rotationopt)

Parameters:
Name Type Attributes Default Description
a_name string <optional>
""
a_sheetIndex number <optional>
std.numeric_limits<uint32_t>.max()
a_coordsMin vec2 <optional>
glm.vec2(0,0)
a_coordsMax vec2 <optional>
glm.vec2(1,1)
a_startXY ivec2 <optional>
glm.ivec2(0,0)
a_size ivec2 <optional>
glm.ivec2(1,1)
a_pivotPoint vec2 <optional>
glm.vec2(0.5,0.5)
a_rotation number <optional>
0

Members

coordsMax :vec2

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

Type:
  • vec2

coordsMin :vec2

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

Type:
  • vec2

name :string

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

Type:
  • string

(static, constant) NONE :lumin.multipack.SubTexture

Sentinal value representing no sub-texture.

Type:

pivotPoint :vec2

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

Type:
  • vec2

rotation :number

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

Type:
  • number

sheetIndex :number

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

Type:
  • number

size :ivec2

The size of the sub texture in pixels.

Type:
  • ivec2

startXY :ivec2

The offest to the starting pixel in the source image.

Type:
  • ivec2

Methods

isNone() → {boolean}

True if name is empty.

Returns:
Type
boolean

toString() → {string}

String representation.

Returns:
Type
string