Skip to content

DrawUtils

final class DrawUtils
Package: dev.joid.lib.draw · Module: core · Source: DrawUtils.java

Entry point of the immediate drawing API, with one helper each for shapes, text, images, 3D models and external rasters.

Nodes draw through these five helpers, and so does your code in the draw of a custom node or in a node layer (Choose where to draw).

Every call draws at once, in the coordinates of the current model-view matrix: design pixels inside a UI. Call them on the render thread, during a frame; outside a frame the render bridge throws.

TypeNameValueSummary
DrawTextTEXTDrawText.inst()Draws and measures text with a TextInfo: DrawText.
DrawShapeSHAPEDrawShape.inst()Draws rectangles, rounded rectangles, borders, circles, shadows, lines, curves and polygons: DrawShape.
DrawModelMODELDrawModel.inst()Draws a 3D model scaled into the UI: DrawModel.
DrawRasterRASTERDrawRaster.inst()Draws what another renderer draws, through an offscreen framebuffer: DrawRaster.
DrawResourceRESOURCEDrawResource.inst()Draws resources and textures: DrawResource.

DrawText TEXT

Draws and measures text with a TextInfo: DrawText.

DrawShape SHAPE

Draws rectangles, rounded rectangles, borders, circles, shadows, lines, curves and polygons: DrawShape.

DrawModel MODEL

Draws a 3D model scaled into the UI: DrawModel.

DrawRaster RASTER

Draws what another renderer draws, through an offscreen framebuffer: DrawRaster.

DrawResource RESOURCE

Draws resources and textures: DrawResource.


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