Class: StateSystem

PIXI.systems.StateSystem

System plugin to the renderer to manage WebGL state machines.

new PIXI.systems.StateSystem (renderer)

Name Type Description
renderer PIXI.Renderer

The renderer this System works for.

Extends

Members

_blendEq boolean protected

Whether current blend equation is different

blendMode number readonly

Blend mode

Default Value:
  • PIXI.BLEND_MODES.NONE

checks Array.<function()> readonly

Collection of check calls

defaultState PIXI.State readonly

Default WebGL State

gl WebGLRenderingContext readonly

GL context

map Array.<function()> readonly

Collection of calls

polygonOffset number readonly

Polygon offset

The renderer this manager works for.

stateId number readonly

State ID

Methods

destroy () inherited

Generic destroy methods to be overridden by the subclass

forceState (state)

Sets the state, when previous state is unknown

Name Type Description
state *

The state to set

Resets all the logic and disables the vaos

set (state)

Sets the current state

Name Type Description
state *

The state to set.

setBlend (value)

Enables or disabled blending.

Name Type Description
value boolean

Turn on or off webgl blending.

setBlendMode (value)

Sets the blend mode.

Name Type Description
value number

The blend mode to set to.

setCullFace (value)

Sets whether to enable or disable cull face.

Name Type Description
value boolean

Turn on or off webgl cull face.

setDepthTest (value)

Sets whether to enable or disable depth test.

Name Type Description
value boolean

Turn on or off webgl depth testing.

setFrontFace (value)

Sets the gl front face.

Name Type Description
value boolean

true is clockwise and false is counter-clockwise

setOffset (value)

Enables or disable polygon offset fill

Name Type Description
value boolean

Turn on or off webgl polygon offset testing.

setPolygonOffset (value, scale)

Sets the polygon offset.

Name Type Description
value number

the polygon offset

scale number

the polygon offset scale

setState () Deprecated : since 5.1.0

See:

updateCheck (func, value)

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.

Name Type Description
func function

the checking function to add or remove

value boolean

should the check function be added or removed.