Class: GlitchFilter

PIXI.filters.GlitchFilter

The GlitchFilter applies a glitch effect to an object.
originalfilter

new PIXI.filters.GlitchFilter (options)

Name Type Description
options object optional

The more optional parameters of the filter.

Name Type Default Description
slices number 5 optional

The maximum number of slices.

offset number 100 optional

The maximum offset amount of slices.

direction number 0 optional

The angle in degree of the offset of slices.

fillMode number 0 optional

The fill mode of the space after the offset. Acceptable values:

seed number 0 optional

A seed value for randomizing glitch effect.

average number false optional

true will divide the bands roughly based on equal amounts where as setting to false will vary the band sizes dramatically (more random looking).

minSize number 8 optional

Minimum size of individual slice. Segment of total sampleSize

sampleSize number 512 optional

The resolution of the displacement map texture.

red number [0,0] optional

Red channel offset

green number [0,0] optional

Green channel offset.

blue number [0,0] optional

Blue channel offset.

See:

Extends

  • PIXI.Filter

Members

PIXI.filters.GlitchFilter.CLAMP int staticreadonly

Fill mode as clamp

PIXI.filters.GlitchFilter.LOOP int staticreadonly

Fill mode as loop

PIXI.filters.GlitchFilter.MIRROR int staticreadonly

Fill mode as mirror

PIXI.filters.GlitchFilter.ORIGINAL int staticreadonly

Fill mode as original

PIXI.filters.GlitchFilter.TRANSPARENT int staticreadonly

Fill mode as transparent

average boolean

true will divide the bands roughly based on equal amounts where as setting to false will vary the band sizes dramatically (more random looking).

Default Value:
  • false

blue PIXI.Point

Blue offset.

direction number

The angle in degree of the offset of slices.

Default Value:
  • 0

fillMode number

The fill mode of the space after the offset.

green PIXI.Point

Green channel offset.

minSize number

Minimum size of slices as a portion of the sampleSize

offset number

The maximum offset value for each of the slices.

offsets Array.<number>

Manually set custom slices offset of displacement bitmap, this is a collection of values from -1 to 1. To change the max offset value set offset.

red PIXI.Point

Red channel offset.

sampleSize number readonly

Height of the displacement map canvas.

seed number

A seed value for randomizing color offset. Animating this value to Math.random() produces a twitching effect.

sizes Array.<number>

Manually custom slices size (height) of displacement bitmap

slices number

The count of slices.

Default Value:
  • 5

texture PIXI.Texture readonly

The displacement map is used to generate the bands. If using your own texture, slices will be ignored.

Methods

destroy ()

Removes all references

Redraw displacement bitmap texture, advanced usage.

refresh ()

Regenerating random size, offsets for slices.

shuffle ()

Shuffle the sizes of the slices, advanced usage.