PIXI.filters.GlitchFilter
class GlitchFilter extends PIXI.Filter
The GlitchFilter applies a glitch effect to an object.
Constructor
new PIXI.filters.GlitchFilter(options: object) → {}
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options | object |
<optional> |
The more optional parameters of the filter. |
|
options.slices | number |
<optional> |
5 |
The maximum number of slices. |
options.offset | number |
<optional> |
100 |
The maximum offset amount of slices. |
options.direction | number |
<optional> |
0 |
The angle in degree of the offset of slices. |
options.fillMode | number |
<optional> |
0 |
The fill mode of the space after the offset. Acceptable values:
|
options.seed | number |
<optional> |
0 |
A seed value for randomizing glitch effect. |
options.average | boolean |
<optional> |
false |
|
options.minSize | number |
<optional> |
8 |
Minimum size of individual slice. Segment of total |
options.sampleSize | number |
<optional> |
512 |
The resolution of the displacement map texture. |
options.red | Array<number> |
<optional> |
[0,0] |
Red channel offset |
options.green | Array<number> |
<optional> |
[0,0] |
Green channel offset. |
options.blue | Array<number> |
<optional> |
[0,0] |
Blue channel offset. |
Summary
Properties from GlitchFilter
number |
Fill mode as clamp |
GlitchFilterOptions |
Default constructor options. |
number |
Fill mode as loop |
number |
Fill mode as mirror |
number |
Fill mode as original |
number |
Fill mode as transparent |
boolean |
|
PIXI.Point | number<Array> |
Blue offset. |
number |
|
number |
The fill mode of the space after the offset. |
PIXI.Point | number<Array> |
Green channel offset. |
number |
Minimum size of slices as a portion of the |
number |
The maximum offset value for each of the slices. |
Array<number> | Float32Array |
|
PIXI.Point | number<Array> |
Red channel offset. |
number |
Height of the displacement map canvas. |
number |
|
Array<number> | Float32Array |
Manually custom slices size (height) of displacement bitmap |
number |
|
PIXI.Texture |
|
Methods from GlitchFilter
Properties inherited from Filter
boolean |
|
PIXI.BLEND_MODES |
|
boolean |
If enabled is true the filter is applied, if false it will not. |
boolean |
|
PIXI.MSAA_QUALITY |
The samples of the filter. |
number |
|
number |
|
PIXI.State |
The WebGL state the filter requires to render. |
Properties inherited from Shader
PIXI.Program |
Program that the shader uses. |
Dict<any> |
|
Public Properties
average: boolean = false
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
Minimum size of slices as a portion of the sampleSize
offsets: Array<number> | Float32Array
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
.
seed: number = 0
A seed value for randomizing color offset. Animating
this value to Math.random()
produces a twitching effect.
sizes: Array<number> | Float32Array
Manually custom slices size (height) of displacement bitmap
texture: PIXI.Texture
The displacement map is used to generate the bands.
If using your own texture, slices
will be ignored.
Public Methods
destroy() → {void}
Removes all references
Type | Description |
---|---|
void |
redraw() → {void}
Redraw displacement bitmap texture, advanced usage.
Type | Description |
---|---|
void |
refresh() → {void}
Regenerating random size, offsets for slices.
Type | Description |
---|---|
void |
shuffle() → {void}
Shuffle the sizes of the slices, advanced usage.
Type | Description |
---|---|
void |