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.
Description
Section titled “Description”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.
Learn more
Section titled “Learn more”Constants and fields
Section titled “Constants and fields”| Type | Name | Value | Summary |
|---|---|---|---|
DrawText | TEXT | DrawText.inst() | Draws and measures text with a TextInfo: DrawText. |
DrawShape | SHAPE | DrawShape.inst() | Draws rectangles, rounded rectangles, borders, circles, shadows, lines, curves and polygons: DrawShape. |
DrawModel | MODEL | DrawModel.inst() | Draws a 3D model scaled into the UI: DrawModel. |
DrawRaster | RASTER | DrawRaster.inst() | Draws what another renderer draws, through an offscreen framebuffer: DrawRaster. |
DrawResource | RESOURCE | DrawResource.inst() | Draws resources and textures: DrawResource. |
Constant and field details
Section titled “Constant and field details”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.
RASTER
Section titled “RASTER”DrawRaster RASTER
Draws what another renderer draws, through an offscreen framebuffer: DrawRaster.
RESOURCE
Section titled “RESOURCE”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
