Skip to content

@blooper.gg/toodle


@blooper.gg/toodle / textures/types / TexelRegion

Type Alias: TexelRegion

TexelRegion = object

Defined in: textures/types.ts:156

A texel region defines a subregion of an individual texture in texel units.

(0,0) is the top left corner of the original texture. (width, height) is the bottom right corner of the original texture.

Example

ts
This is useful for something like spritesheet animations,
for eg a 3-frame pose of a 32x32 character sprite might be 96x32 texels, and the animation could
be done by alternating between:

{ x: 0, y: 0, width: 32, height: 32 }
{ x: 32, y: 0, width: 32, height: 32 }
{ x: 64, y: 0, width: 32, height: 32 }

Properties

height

height: number

Defined in: textures/types.ts:160


width

width: number

Defined in: textures/types.ts:159


x

x: number

Defined in: textures/types.ts:157


y

y: number

Defined in: textures/types.ts:158