Skip to content

ShadowShader

final class ShadowShader
Extends: ShaderProgram
Package: dev.joid.lib.shader.impl · Module: core · Source: ShadowShader.java

The shader of soft shadows, which draws the blurred silhouette of a rounded box.

DrawShape.drawShadow uses it.

ReturnsSignatureSummary
ShadowShaderinst() factoryReturns the shared shader.

ReturnsSignatureSummary
voiduse(float radius, float blur, float x1, float y1, float x2, float y2, Runnable runnable) staticRuns runnable with the shader bound on the box x1, y1, x2, y2, its corner radius and its blur, then restores the previous shader.
voidbind(float radius, float blur, float x1, float y1, float x2, float y2)Binds the shader on the box, with every corner rounded.
voidsides(boolean left, boolean top, boolean right, boolean bottom)Rounds only the corners of the chosen sides, as DrawShape.drawRoundedRect does; call it after bind.
Inherited from ShaderProgram (7)

delete · unbind · getShader · canDraw · isAvailable · gradient · uniformGradient

ShadowShader inst() factory

Returns the shared shader.

void use(float radius, float blur, float x1, float y1, float x2, float y2, Runnable runnable) static

Runs runnable with the shader bound on the box x1, y1, x2, y2, its corner radius and its blur, then restores the previous shader. Draw a quad that covers the box plus 1.5 times the blur on each side.

void bind(float radius, float blur, float x1, float y1, float x2, float y2)

Binds the shader on the box, with every corner rounded.

void sides(boolean left, boolean top, boolean right, boolean bottom)

Rounds only the corners of the chosen sides, as DrawShape.drawRoundedRect does; call it after bind.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page