Read our guide on Shaders for an explanation of these blocks.
Applies the specified shader to the game. This replaces the existing shader. To use multiple shaders at a time, use the combine shader blocks below.
[SHADER].enable();
Removes the existing shader from the game.
engine.clearShaders();
Enables/disables shaders for the HUD (top, non-scrolling) layer.
engine.toggleShadersForHUD();
Combines 2 shaders together. If combining more than 2, stick further combines in the second slot.
[SHADER].combine([SHADER])
Combines 3 shaders together.
[SHADER].combine([SHADER]).combine([SHADER])
Combines 4 shaders together.
[SHADER].combine([SHADER]).combine([SHADER]).combine([SHADER])
Loads a shader placed into a game's extras directory.
new ExternalShader([TEXT])
Define a shader inline using GLSL.
new InlineShader([TEXT])
Instantly set a shader's properties. This lets you tweak a shader (in ways that the blocks don't allow) and alter its appearance after creation.
Consult our Shaders article for property names.
[SHADER].setProperty([TEXT], [VALUE]);
Change a shader's properties over time. Consult our Shaders article for property names.
[SHADER].tweenProperty([TEXT], [NUMBER], [NUMBER], [EASING]);
Makes animated shaders run faster/slower. Useful for porting shaders written for other environments. 1.0 is normal time. 2.0 is twice as fast.
[SHADER].setTimeScale([NUMBER]);
Adjusts the screen's hue in degrees.
new HueShader([NUMBER])
Adjust the screen's contrast, saturation or brightness, in percentages. 100% means original value, 200% means twice as much, 50% means half as much.
CSBShader.create("contrast", [NUMBER]/100)
CSBShader.create("saturation", [NUMBER]/100)
CSBShader.create("brightness", [NUMBER]/100)
Apply a color-based tint to the screen using the specified opacity in pecentage between 0% (no tint), 100% (full tint).
new TintShader([COLOR], [NUMBER]/100)
Apply simple filters (grayscale, inverse, sepia) to the screen.
new GrayscaleShader()
new InvertShader()
new SepiaShader()
Applies a directional blur to the screen. x/y collectively define a 'slope' for the direction, so -1,-1 is a diagonal blur.
new BlurShader([NUMBER], [NUMBER], [NUMBER])
Sharpen with the given intensity.
new SharpenShader([NUMBER])
Causes highlights (bright areas) to bleed and glow.
new BloomShader()
Apply a dynamic, film grain effect to the screen.
new GrainShader()
Apply TV-like scanlines to the screen.
new ScanlineShader([NUMBER])