PIXI.StateSystem

class StateSystem implements PIXI.ISystem

System plugin to the renderer to manage WebGL state machines.

Summary


Properties from StateSystem

PIXI.BLEND_MODES
blendMode = PIXI.BLEND_MODES.NONE
number
polygonOffset
number
stateId
boolean
protected _blendEq

Whether current blend equation is different

Array<Function>
protected checks
PIXI.State
protected defaultState
WebGLRenderingContext
protected gl
Array<Function>
protected map

Methods from StateSystem

void
forceState(state: unknown)
void
reset()

Resets all the logic and disables the VAOs.

void
set(state: unknown)
void
setBlend(value: boolean)
void
setBlendMode(value: number)
void
setCullFace(value: boolean)
void
setDepthMask(value: boolean)
void
setDepthTest(value: boolean)
void
setFrontFace(value: boolean)
void
setOffset(value: boolean)
void
setPolygonOffset(value: number, scale: number)
void
updateCheck(func: (system: this, state: PIXI.State) => void, value: boolean)

Checks to see which updates should be checked based on which settings have been activated.

Public Properties


blendMode StateSystem.ts:33
blendMode: PIXI.BLEND_MODES = PIXI.BLEND_MODES.NONE

Blend mode

polygonOffset StateSystem.ts:27
polygonOffset: number

Polygon offset

stateId StateSystem.ts:21
stateId: number

State ID

Protected Properties


_blendEq StateSystem.ts:40
protected _blendEq: boolean

Whether current blend equation is different

checks StateSystem.ts:58
protected checks: Array<Function>

Collection of check calls

defaultState StateSystem.ts:64
protected defaultState: PIXI.State

Default WebGL State

gl StateSystem.ts:43
protected gl: WebGLRenderingContext

GL context

map StateSystem.ts:52
protected map: Array<Function>

Collection of calls

Public Methods


forceState StateSystem.ts:145
forceState(state: unknown) → {void}

Sets the state, when previous state is unknown.

Parameters:
Name Type Description
state unknown

The state to set

Returns:
Type Description
void
reset StateSystem.ts:269
reset() → {void}

Resets all the logic and disables the VAOs.

Returns:
Type Description
void
set StateSystem.ts:106
set(state: unknown) → {void}

Sets the current state

Parameters:
Name Type Description
state unknown

The state to set.

Returns:
Type Description
void
setBlend StateSystem.ts:164
setBlend(value: boolean) → {void}

Sets whether to enable or disable blending.

Parameters:
Name Type Description
value boolean

Turn on or off WebGl blending.

Returns:
Type Description
void
setBlendMode StateSystem.ts:222
setBlendMode(value: number) → {void}

Sets the blend mode.

Parameters:
Name Type Description
value number

The blend mode to set to.

Returns:
Type Description
void
setCullFace StateSystem.ts:204
setCullFace(value: boolean) → {void}

Sets whether to enable or disable cull face.

Parameters:
Name Type Description
value boolean

Turn on or off webgl cull face.

Returns:
Type Description
void
setDepthMask StateSystem.ts:195
setDepthMask(value: boolean) → {void}

Sets whether to enable or disable depth mask.

Parameters:
Name Type Description
value boolean

Turn on or off webgl depth mask.

Returns:
Type Description
void
setDepthTest StateSystem.ts:186
setDepthTest(value: boolean) → {void}

Sets whether to enable or disable depth test.

Parameters:
Name Type Description
value boolean

Turn on or off webgl depth testing.

Returns:
Type Description
void
setFrontFace StateSystem.ts:213
setFrontFace(value: boolean) → {void}

Sets the gl front face.

Parameters:
Name Type Description
value boolean

true is clockwise and false is counter-clockwise

Returns:
Type Description
void
setOffset StateSystem.ts:175
setOffset(value: boolean) → {void}

Sets whether to enable or disable polygon offset fill.

Parameters:
Name Type Description
value boolean

Turn on or off webgl polygon offset testing.

Returns:
Type Description
void
setPolygonOffset StateSystem.ts:258
setPolygonOffset(value: number, scale: number) → {void}

Sets the polygon offset.

Parameters:
Name Type Description
value number

the polygon offset

scale number

the polygon offset scale

Returns:
Type Description
void
updateCheck StateSystem.ts:281
updateCheck(func: (system: this, state: PIXI.State) => void, value: boolean) → {void}

Checks to see which updates should be checked based on which settings have been activated.

For example, if blend is enabled then we should check the blend modes each time the state is changed or if polygon fill is activated then we need to check if the polygon offset changes. The idea is that we only check what we have too.

Parameters:
Name Type Description
func (system: this, state: PIXI.State) => void

the checking function to add or remove

value boolean

should the check function be added or removed.

Returns:
Type Description
void

Powered by webdoc!