o
odinpkg.dev
packages / tool / 8x16

8x16

53e526ctool

Simple UI geomtry toolkit based on 8x16 VGA cells

No license · updated 2 days ago

8x16

Small immediate-mode UI package for Odin workbenches.

The design kernel is fixed 8x16 cell geometry: layout is expressed in integer cells, while drawing backends translate those cells to pixels. The initial target is boring, predictable UI for small tools: boxes, labels, buttons, toggles, bars, hitboxes, and debug warnings for text overflow.

Packages

  • ui8x16 contains the core immediate-mode UI package.
  • raylib_8x16 renders primitive draw commands with raylib.
  • examples contains runnable application examples.

The core package has no raylib dependency. Raylib integration lives in the backend package, and runnable examples own raylib window setup and the frame loop.

Frame Model

8x16 separates interaction, lowering, and rendering:

sample platform input
  -> ui_begin_frame
  -> interaction/query phase
  -> caller updates app state
  -> lowering phase
  -> ordered primitive draw commands
  -> backend render

UI layout should be discussed in cells:

1 UI column = 8 px
1 UI row    = 16 px

Pixels are backend output. Rows, columns, and cell rectangles are the tractable layout vocabulary.

Source

The canonical implementation source is 8x16.org. Generated Odin package files live under ui8x16, raylib_8x16, and examples.

After editing 8x16.org, regenerate generated files:

.ephemera/tangle-org.sh 8x16.org

See SPEC.org for the current v0 contract.

Examples

Run the stateful raylib drawing example from the repository root:

odin run examples/drawing_app.odin -file

Run the static control layout-options example:

odin run examples/layout_options_app.odin -file

Build examples without launching a window:

odin build examples/drawing_app.odin -file -out:/tmp/8x16-drawing-app
odin build examples/layout_options_app.odin -file -out:/tmp/8x16-layout-options-app

The example uses the bundled PxPlus_IBM_VGA_8x16.ttf font from the Oldschool PC Font Pack. Font attribution and CC BY-SA 4.0 license text live in assets/fonts/README.md.

Verification

Run the package checks and tests:

odin check ui8x16 -no-entry-point -vet-style -vet-tabs
odin test ui8x16 -vet-style -vet-tabs
odin check raylib_8x16 -no-entry-point -vet-style -vet-tabs
odin test raylib_8x16 -vet-style -vet-tabs
odin test examples/surfaces -vet-style -vet-tabs

Build the example without launching a window:

odin build examples/drawing_app.odin -file -out:/tmp/8x16-drawing-app -vet-style -vet-tabs
odin build examples/layout_options_app.odin -file -out:/tmp/8x16-layout-options-app -vet-style -vet-tabs