Skip to main content

Module raster

Module raster 

Source
Expand description

The designer’s stand-in for the game’s DrawContext: a display list of draw2d_* calls (what yog-ui’s renderer — or a mod’s own render code — issues) rasterized the way the Yog hosts draw them in game: coordinates truncated to whole GUI pixels (NativeDraw casts with (int)), alpha blending, Minecraft’s font (see font) and textures. Output is RGBA at scale physical pixels per GUI pixel, for the canvas to show with nearest-neighbour scaling.

Structs§

Canvas
An RGBA canvas w × h physical pixels.

Enums§

DrawOp
One draw2d_* call (GUI pixels, colors 0xAARRGGBB).

Functions§

fit_scale
scale clamped to 1..=8, lowered until a gui_w×gui_h canvas fits [MAX_PIXELS].
rasterize
Rasterizes a display list.