cf_art
One-paragraph description of what this module provides and who consumes it.
[name]
One-paragraph description of what this module provides and who consumes it.
Exports
M.exampleFn(arg) -> result— what it does and when to call it.M.exampleValue: type— what value it carries.
Usage
local M = require("@<youridentity>::modules.[name]")
M.exampleFn("foo")
Notes
- Anything callers need to know about THIS module: required runtime ordering, state ownership, side effects.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2COINFALL's texture atelier: the palette every surface is painted from, a small raster canvas, and the encoder that turns a canvas into a point-sampled `.texture` asset. Textures are 64-128px, hand-painted here in code, and never mipped -- the 1998 constraint the whole look rests on.
rng(seed: number) → void
| arg | type | description |
|---|---|---|
| seed | number |
next( ) → number
range(lo: number, hi: number) → number
| arg | type | description |
|---|---|---|
| lo | number | |
| hi | number |
pick(list: ?) → void
| arg | type | description |
|---|---|---|
| list | ? |
canvas(w: number, h: number, color: ?) → void
A blank RGBA canvas, opaque and filled with `color` (default void).
| arg | type | description |
|---|---|---|
| w | number | |
| h | number | |
| color | ? |
set(x: number, y: number, c: ?, alpha: number?) → void
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| c | ? | |
| alpha | number? |
get(x: number, y: number) → void
| arg | type | description |
|---|---|---|
| x | number | |
| y | number |
rect(x: number, y: number, w: number, h: number, c: ?, alpha: number?) → void
Fill a rectangle in pixel coordinates (x, y, w, h), clipped to the canvas.
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| w | number | |
| h | number | |
| c | ? | |
| alpha | number? |
frame(x: number, y: number, w: number, h: number, c: ?, t: number?) → void
Stroke a rectangle outline `t` pixels thick, inset inside the bounds.
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| w | number | |
| h | number | |
| c | ? | |
| t | number? |
line(x0: number, y0: number, x1: number, y1: number, c: ?) → void
A one-pixel Bresenham line.
| arg | type | description |
|---|---|---|
| x0 | number | |
| y0 | number | |
| x1 | number | |
| y1 | number | |
| c | ? |
speck(rng: ?, x: number, y: number, w: number, h: number, c: ?, count: number) → void
Scatter `count` single-pixel specks of `c` inside a rect -- grime, static, wear.
| arg | type | description |
|---|---|---|
| rng | ? | |
| x | number | |
| y | number | |
| w | number | |
| h | number | |
| c | ? | |
| count | number |
grain(rng: ?, x: number, y: number, w: number, h: number, amount: number) → void
Per-pixel value jitter inside a rect. The cheapest way to stop a flat fill reading as a modern gradient-free plane.
| arg | type | description |
|---|---|---|
| rng | ? | |
| x | number | |
| y | number | |
| w | number | |
| h | number | |
| amount | number |
checker(x: number, y: number, w: number, h: number, a: ?, b: ?, size: number?) → void
A 2px checker of two colours -- panel vents, floor tile, grille mesh.
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| w | number | |
| h | number | |
| a | ? | |
| b | ? | |
| size | number? |
scanbars(x: number, y: number, w: number, h: number, c: ?, every: number?) → void
Horizontal scan bars -- the tell of a powered CRT face.
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| w | number | |
| h | number | |
| c | ? | |
| every | number? |
vgrad(x: number, y: number, w: number, h: number, top: ?, bottom: ?) → void
Vertical linear blend between two colours across the rect.
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| w | number | |
| h | number | |
| top | ? | |
| bottom | ? |
wash(x: number, y: number, w: number, h: number, c: ?, t: number) → void
Blend `c` over the rect at `t` (0..1) -- staining, soot, wash.
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| w | number | |
| h | number | |
| c | ? | |
| t | number |
disc(cx: number, cy: number, r: number, c: ?) → void
A filled circle -- bulbs, coin faces, eyes.
| arg | type | description |
|---|---|---|
| cx | number | |
| cy | number | |
| r | number | |
| c | ? |
text(x: number, y: number, str: string, c: ?, scale: number?) → void
Stamp uppercase text at (x, y). `scale` multiplies the 4x6 cell. Returns the width in pixels consumed, so callers can centre a line.
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| str | string | |
| c | ? | |
| scale | number? |
textWidth(str: string, scale: number?) → number
Pixel width `text` would consume at `scale`, for centring.
| arg | type | description |
|---|---|---|
| str | string | |
| scale | number? |
payload( ) → void
The canvas as the raw-pixel payload `asset.create("texture", ...)` takes. Point-sampled and un-mipped: both are required for the look, since a mipped, linearly-filtered texture is the single fastest way to stop reading as 1998. The minting itself lives in the `coinfall` toolbox -- creating assets is an authoring operation, not something a module on the gameplay path does.
cell(cx: number, cy: number, n: number, atlasSize: number?) → void
The UV rect of one cell in an `n`x`n` atlas grid, inset by half a texel so affine interpolation cannot reach into the neighbouring cell.
| arg | type | description |
|---|---|---|
| cx | number | |
| cy | number | |
| n | number | |
| atlasSize | number? |
cellTiled(cx: number, cy: number, n: number, tu: number, tv: number) → void
A cell rect tiled `times` over -- for architecture that repeats a cell across a long surface. The v range is untouched so the cell stays upright.
| arg | type | description |
|---|---|---|
| cx | number | |
| cy | number | |
| n | number | |
| tu | number | |
| tv | number |
cellPx(cx: number, cy: number, n: number, size: number) → void
Pixel bounds of atlas cell (cx, cy) on an `n`x`n` grid of `size` texels.
| arg | type | description |
|---|---|---|
| cx | number | |
| cy | number | |
| n | number | |
| size | number |
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.