Make your first scene
Save a complete .nothing still, render it, and predict where it paints.
Save the complete example below as first-scene.nothing in the repository root as UTF-8. Its only drawable is a 40 × 40 rectangle painted opaque terracotta. You can also start with the runnable file.
<scene width="64" height="64">
<shape translate-x="28" translate-y="28">
<rect width="40" height="40"/>
<fill><paint><solid color="#CD6843FF"/></paint></fill>
</shape>
</scene>- The
sceneestablishes a transparent 64 × 64 canvas. The origin is the top left. X increases right and Y increases down. - The
rectgives theshapea contour. By default its center is the shape’s local origin. The shape’s translation places that center at (28, 28). - The
fillpaints the interior. Itspaintcontains onesolidvalue in#RRGGBBAAnotation. The finalFFgives full opacity.
Render and edit the still
The Rust preview includes fonts from the pinned shared fixture checkout. With Git and Rustup available, initialize that checkout once from the repository root.
git submodule update --init --checkout third_party/externals/fixtures
bin/check-fixturesThen pass the file you just saved to the Rust preview CLI. Run Cargo from ncf to use the project’s pinned Rust toolchain.
(cd ncf && cargo run --locked -p ncf-preview -- \
../first-scene.nothing -o ../first-scene.svg)Open first-scene.svg in a browser. The rectangle starts at (8, 8) and its right and bottom boundaries are both 48. At one pixel per scene unit, pixel (8, 8) is terracotta and pixel (48, 48) is transparent. The scene can render with authored base values because it has neither timed placements nor animation tracks. Preview CLI · Canvas and clock
Edit the shape’s translate-x from 28 to 36 and render again. The X boundaries become 16 and 56. Then change only the rectangle’s width from 40 to 24. The X boundaries become 24 and 48, centered at 36. Both edits leave the 64 × 64 canvas and the Y boundaries fixed. Use the .nothing source for edits. The exported SVG describes the rendered sample.
Next, rotate and resize around a chosen point or add paint and stroke detail.
Examples
Download the complete .nothing source · Source on GitHub
Rendered with ncf-preview at 64 × 64.
