This Game Object is a quad which displays a gradient. You can manipulate this object like any other, make it interactive, and use it in filters and masks to create visually stunning effects.
Behind the scenes, a Gradient is a Phaser.GameObjects.Shader using a specific shader program.
The gradient color is determined by a Phaser.Display.ColorRamp, containing one or more Phaser.Display.ColorBand objects. The ramp is laid out along the shape of the gradient, originating from the start location. The shapeMode describes how the gradient fills elsewhere, e.g. a LINEAR gradient creates straight bands while a RADIAL gradient creates circles.
Note that the shape of the gradient is fitted to a square. If its width and height are not equal, the shape will be distorted. This may be what you want.
A Gradient can be animated by modifying its offset property, or by modifying the ramp data. If you modify ramp data, you may have to call gradient.ramp.encode() to rebuild it.
A Gradient Game Object.
This Game Object is a quad which displays a gradient. You can manipulate this object like any other, make it interactive, and use it in filters and masks to create visually stunning effects.
Behind the scenes, a Gradient is a
Phaser.GameObjects.Shaderusing a specific shader program.The gradient color is determined by a
Phaser.Display.ColorRamp, containing one or morePhaser.Display.ColorBandobjects. The ramp is laid out along theshapeof the gradient, originating from thestartlocation. TheshapeModedescribes how the gradient fills elsewhere, e.g. a LINEAR gradient creates straight bands while a RADIAL gradient creates circles.Note that the shape of the gradient is fitted to a square. If its width and height are not equal, the shape will be distorted. This may be what you want.
A Gradient can be animated by modifying its
offsetproperty, or by modifying the ramp data. If you modify ramp data, you may have to callgradient.ramp.encode()to rebuild it.