Skip to content

textmode.js v0.19.0: Expose layer background and rebuild the example gallery

Latest

Choose a tag to compare

@humanbydefinition humanbydefinition released this 29 Nov 01:00

New API: read a layer's background

TextmodeLayer.background returns the background last set while the layer was drawing, or null after clear() or before one has been set.

const veil = t.layers.add();

veil.draw(() => {
	t.background(14, 38, 52);
});

veil.background; // TextmodeColor | null

The accessor reports only the layer's own explicit background. It does not include inherited renderer state or the composited canvas background. It pairs with the background: 'layer' option added in textmode.export.js 1.11.0.

Rebuilt example gallery

  • All 386 example sketches rebuilt around a shared label panel, responsive font sizes, and descriptive naming.
  • New TextmodeLayer.background example.
  • Example statuses reset to unrated for the next review pass.
  • Every runnable example is available as an editor in the API reference on code.textmode.art.

Internal organization

No public API changed in this section.

  • src/textmode/fonts is now src/textmode/charset. The fonts namespace, TextmodeFont, TextmodeTileset, and all type exports keep their names.
  • Built-in extensions are grouped under extensions/input and extensions/text.
  • loadFont, loadTileset, fontSize, useTileColors, and the font accessor moved into extensions/text/charset.ts. They still attach to Textmodifier.prototype.

Examples, assets, and tooling

  • Add BESCII Mono (CC0) and the Rook tileset to examples/assets, with attribution in THIRD_PARTY_LICENSES.md.
  • Update @textmode/docs to 0.4.3 and @textmode/lint to 0.1.3.
  • Remove the redundant blend-mode shader constants check.

Compatibility

This release adds the TextmodeLayer.background accessor. No existing export or signature changes, so current sketches continue to run as they are.

npm install textmode.js@0.19.0

Full changelog: v0.18.2...v0.19.0