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.
Description
Section titled “Description”DrawShape.drawShadow uses it.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
ShadowShader | inst() factory | Returns the shared shader. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
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. |
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. |
Inherited from ShaderProgram (7)
delete · unbind · getShader · canDraw · isAvailable · gradient · uniformGradient
Creation details
Section titled “Creation details”ShadowShader inst() factory
Returns the shared shader.
Method details
Section titled “Method details”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
