GradientShader
final class GradientShader
Extends: ShaderProgram
Package: dev.joid.lib.shader.impl · Module: core · Source: GradientShader.java
The shader of linear gradients, which colors what is drawn along a line between two stops.
Description
Section titled “Description”Color.bind and ColorGradient.use use it for a gradient color; you rarely call it yourself.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
GradientShader | inst() factory | Returns the shared shader. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
void | use(Point startPoint, Point endPoint, Color startColor, Color endColor, Runnable runnable, BoundingBox canvas) static | Runs runnable with the gradient from startColor at startPoint to endColor at endPoint, points on 1 of canvas, then restores the previous shader. |
void | use(Point startPoint, Point endPoint, Color startColor, Color endColor, boolean hasTexture, Runnable runnable, BoundingBox canvas) static | Runs runnable with the gradient from startColor at startPoint to endColor at endPoint, then restores the previous shader; if hasTexture is true, the gradient multiplies the bound texture instead of replacing it. |
Inherited from ShaderProgram (8)
delete · bind · unbind · getShader · canDraw · isAvailable · gradient · uniformGradient
Creation details
Section titled “Creation details”GradientShader inst() factory
Returns the shared shader.
Method details
Section titled “Method details”void use(Point startPoint, Point endPoint, Color startColor, Color endColor, Runnable runnable, BoundingBox canvas) static
Runs runnable with the gradient from startColor at startPoint to endColor at endPoint, points on 1 of canvas, then restores the previous shader.
void use(Point startPoint, Point endPoint, Color startColor, Color endColor, boolean hasTexture, Runnable runnable, BoundingBox canvas) static
Runs runnable with the gradient from startColor at startPoint to endColor at endPoint, then restores the previous shader; if hasTexture is true, the gradient multiplies the bound texture instead of replacing it.
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
