BorderShaderPass
class BorderShaderPass
Implements: IShaderPass
Package: dev.joid.lib.shader.pipeline.pass · Module: core · Source: BorderShaderPass.java
Outlines the shape of the previous result with a colored stroke that follows its alpha, rounded corners included.
Description
Section titled “Description”The stroke follows the edge of what was drawn, so it wraps a rounded or circular shape drawn by an earlier pass.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
BorderShaderPass | create(Color color, float width) factory | Creates a border of color, gradient and animated colors included, width design pixels wide. |
| BorderShaderPass(Color color, float width) protected | Creates the pass, for a subclass. |
Properties
Section titled “Properties”| Property | Type | Default | Summary |
|---|---|---|---|
| corners | boolean | true | If true, the stroke also covers the outer corners of the area; if false, the corner zones, where the stroke goes past the area in x and in y at once, keep the previous result unchanged. |
| mode | BorderMode | BorderMode.OUT | Where the stroke sits: BorderShader.BorderMode.OUT outside the edge of the shape, BorderShader.BorderMode.IN inside it. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
void | bind(ShaderPassContext context) | Binds the border shader with the width in screen pixels, the color and the area. |
void | unbind() | Unbinds the border shader. |
float | expansion() | Returns the width plus 2 design pixels, the room an outer stroke needs. |
double | reach(double scale) | Returns twice the width in screen pixels, plus one pixel. |
Creation details
Section titled “Creation details”create
Section titled “create”BorderShaderPass create(Color color, float width) factory
Creates a border of color, gradient and animated colors included, width design pixels wide.
BorderShaderPass
Section titled “BorderShaderPass”BorderShaderPass(Color color, float width) protected
Creates the pass, for a subclass.
Property details
Section titled “Property details”corners
Section titled “corners”this corners(boolean corners)fluent
Default: true
If true, the stroke also covers the outer corners of the area; if false, the corner zones, where the stroke goes past the area in x and in y at once, keep the previous result unchanged.
this mode(BorderMode mode)fluent
Default: BorderMode.OUT
Where the stroke sits: BorderShader.BorderMode.OUT outside the edge of the shape, BorderShader.BorderMode.IN inside it.
Method details
Section titled “Method details”void bind(ShaderPassContext context)
Binds the border shader with the width in screen pixels, the color and the area.
unbind
Section titled “unbind”void unbind()
Unbinds the border shader.
expansion
Section titled “expansion”float expansion()
Returns the width plus 2 design pixels, the room an outer stroke needs.
double reach(double scale)
Returns twice the width in screen pixels, plus one pixel.
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
