Skip to main content

Module portrait

Module portrait 

Source
Expand description

Drawing a picture in an area of cells (game ADR-0043): one sprite item, the image at the largest whole scale that fits, centred. A game’s portraits are drawn this way.

Functions§

dim_opacity
The opacity of a picture dimmed by dim (0 = full color, 1 = gone): the renderer fades every pixel toward what is behind it (game ADR-0018).
draw_fitted
Draws image (of size pixels) in the area of (w, h) cells whose top-left cell is (x, y), at the largest whole scale that fits it, centred, as one sprite under the glyphs: a transparent pixel shows the cells’ background, so clear the area first. dim (0 = full color, 1 = gone) fades it toward that background; mirror flips it left to right. Clipped to the buffer. Draws nothing if the picture is too big for the area even at 1×.
fit_whole_scale
Where an image of size is drawn in frame (console pixels): at the largest whole scale that fits, centred (an odd pixel left over goes to the right or the bottom). None if it doesn’t fit even at 1×, or has no pixels.