Skip to content

Documentation / spryte / SpriteDrawOptions

Interface: SpriteDrawOptions ​

Defined in: draw.ts:20

Properties ​

alpha? ​

optional alpha?: number

Defined in: draw.ts:30

Multiplied with the global alpha.


flash? ​

optional flash?: number

Defined in: draw.ts:34

0..1 mix toward white, e.g. hit flashes.


flipX? ​

optional flipX?: boolean

Defined in: draw.ts:27


flipY? ​

optional flipY?: boolean

Defined in: draw.ts:28


origin? ​

optional origin?: readonly [number, number]

Defined in: draw.ts:22

Anchor as a fraction of the frame size. Default [0.5, 0.5] (centre).


rotation? ​

optional rotation?: number

Defined in: draw.ts:26

Radians.


scaleX? ​

optional scaleX?: number

Defined in: draw.ts:23


scaleY? ​

optional scaleY?: number

Defined in: draw.ts:24


smooth? ​

optional smooth?: boolean

Defined in: draw.ts:36

Linear filtering for this sprite. Default: the game's setting (off when pixelArt).


tint? ​

optional tint?: Color

Defined in: draw.ts:32

Colour multiplier. Default white.


user? ​

optional user?: number

Defined in: draw.ts:42

A float a custom shader reads as user() for this sprite (since 0.16): a share, a variant, a flag. Default 0. It stays in the batch, as draw.sprites' each.user does. WebGL2 only, and only inside withShader; without a custom shader, and on the Canvas 2D fallback, it does nothing.


user2? ​

optional user2?: number

Defined in: draw.ts:44

A second float, read as user2() (since 0.16). Default 0.