Skip to content

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.

The stroke follows the edge of what was drawn, so it wraps a rounded or circular shape drawn by an earlier pass.

ReturnsSignatureSummary
BorderShaderPasscreate(Color color, float width) factoryCreates a border of color, gradient and animated colors included, width design pixels wide.
BorderShaderPass(Color color, float width) protectedCreates the pass, for a subclass.

PropertyTypeDefaultSummary
cornersbooleantrueIf 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.
modeBorderModeBorderMode.OUTWhere the stroke sits: BorderShader.BorderMode.OUT outside the edge of the shape, BorderShader.BorderMode.IN inside it.

ReturnsSignatureSummary
voidbind(ShaderPassContext context)Binds the border shader with the width in screen pixels, the color and the area.
voidunbind()Unbinds the border shader.
floatexpansion()Returns the width plus 2 design pixels, the room an outer stroke needs.
doublereach(double scale)Returns twice the width in screen pixels, plus one pixel.

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.

  • 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.

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.


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