# Authoring .nothing Level 1
> Version 0.9.0 is the ratified internal rehearsal of the .nothing scene format. Use this guide to write a scene, predict what it does at a particular time, or patch an owned property. The XML has no version field.
[Make a complete scene](https://nothing.graphics/docs/format/guides/first-scene) · [Look up an element](https://nothing.graphics/docs/format/reference/elements) · [Look up an attribute](https://nothing.graphics/docs/format/reference/attributes) · [Download the full manual](https://nothing.graphics/docs/format/llms-full.txt)
## Start with the owner
Write UTF-8 XML 1.0 with one unnamespaced `scene` root and case-sensitive ASCII vocabulary. Whitespace between elements is for formatting except inside `text` and `span`, where it contributes literal copy. A strict reader reports malformed XML, unknown elements, unsupported operations, invalid owners or values, and unavailable resources at their source location and refuses the requested result. Extra attributes carry opaque host metadata. They survive unrelated edits and have no rendering effect. A host spelling list can recognize them during linting. A best-effort reader identifies each degradation. [Source and diagnostics](https://nothing.graphics/docs/format/spec)
For a fixed canvas, give it a positive finite `width` and `height` together. Its origin is (0, 0). With both dimensions omitted the caller supplies the viewport. Set `background="#142838FF"` on the scene for a solid canvas, transparent by default. It follows the resolved viewport on resize. Animate `background` directly on the scene to change the color on its clock. Scene children draw over the background in source order.
Declare a 2D view with `` directly under a scene, then name it with `camera="close"` on the scene. Camera center maps to viewport center. Key the camera's numeric properties to move the view, or key `scene.camera` with `ease="hold"` to cut between named views. The view moves artwork inside the fixed viewport background. [Cameras](https://nothing.graphics/docs/format/spec/spatial#cameras)
The perspective focus trial accepts ``. Set the scene's `camera="shot"` and put its root artwork in `plane` elements. Animate `focus-distance` on the camera to move the sharp plane without changing framing. Zero `f-stop` selects a pinhole. Use held segments when switching between zero and positive f-stop values. The trial spellings, units and defaults remain under review. [Perspective optics](https://nothing.graphics/docs/format/spec/perspective-camera-optics) · [Runnable focus trial](https://github.com/gridaco/nothing/blob/main/ncf/conformance/README.md#perspective-focus-pull)
A shape owns one geometry, an optional fill, and any number of strokes. A still rectangle with one fill can be a complete scene.
```xml
```
To widen the rectangle around (32, 24), edit only `rect.width`. Set `rotate` on the shape to spin around the same point. Editing `scene.width` changes the canvas. Flatten shared styles and component overrides into locally owned values when writing a scene. Preserve unrelated source bytes when patching it. A save with no edits preserves the original bytes.
## Attach a drawable to a shape
Nest a `shape`, `group` or `sequence` beside a shape’s geometry. The nearest enclosing shape provides the host geometry. At scene level the host is the resolved canvas. A plain group and an inline sequence pass the host through. A referenced scene supplies its own canvas.
```xml
```
The arrow follows the last segment. Change the line’s last point and the arrow follows it. Change `vertex="2"` to `vertex="1"` and the arrow moves to the bend. Choose one locator kind per drawable.
- **Bounds.** `u="1" v="0"` selects the top-right corner before paint or transforms. Each axis is independent. An omitted axis stays at the parent’s coordinate zero. A single-line text host at `x="0" y="0"` with default start alignment and LTR direction can place a caret at its end with `u="1"`. An authored `inline-size` gives the box its width.
- **Contour.** `along="0.5"` selects half the local contour length using the stroke trim’s measure. Closed contours wrap across laps. Key `along` to move a drawable over its host.
- **Vertex.** `vertex="1.5"` is halfway by length from the second authored point to the third. Lines, point lists and single-subpath paths supply vertices. Inserting a point renumbers later indices.
Give each keyed locator an authored base. Use `orient="auto"` on a contour or vertex to face the path. A whole vertex bisects the corner. The offset from `translate-x` and `translate-y` turns with this frame. A mask source can use a locator. Boolean operands supply the geometry itself and cannot attach. A drawable before the geometry paints beneath its host, one after the geometry paints above it. The host’s filter, mask and opacity apply once to the assembled picture. [Placement, limits and diagnostics](https://nothing.graphics/docs/format/spec/attached-drawables) · [Editable cases](https://github.com/gridaco/nothing/tree/main/ncf/conformance/attached-drawables/)
## Animate one owned value
Give a timed scene a frame rate. Place an animation directly on the element that owns the property you want to change. Here a gradient owns the stops, and one stop owns a track.
```xml
```
The middle stop is at 0.525 at frame 6. Drag it to 70% at the existing frame-12 key and the patch changes just `value="0.65"` to `value="0.70"`. At frame 6 it now samples to 0.55. The base offset stays 0.4. A seek to any frame reproduces its value independently of the previous frame.
## Choose geometry
- Coordinates increase rightward and downward. Size a `rect` with `width` and `height`, a `circle` with `r`, or an `ellipse` with `rx` and `ry`.
- On these three geometries, `anchor-u` and `anchor-v` select a point as fractions of the geometry's own width and height. All three default to center (0.5, 0.5), independently on each axis. Set only `anchor-u="0"` to keep the left edge fixed through a width edit. Any finite fraction is valid, including values outside [0, 1]. The selected point lands at (`offset-x`, `offset-y`) in the drawable's local coordinates. Each offset is a signed finite length and defaults to zero. For example, `` keeps the right edge eight units left of the origin as the width changes. Key any of the four fields directly on the geometry. To move the whole drawable, translate its `shape`. To place a child at the host's right midpoint, put `u="1" v="0.5"` on the child drawable. [Boxed geometry](https://nothing.graphics/docs/format/spec/boxed-geometry) · [Expected samples](https://github.com/gridaco/nothing/tree/main/ncf/conformance/boxed-geometry/)
- A `line` takes endpoints in `x1 y1 x2 y2`. A `polyline` or `polygon` takes coordinate pairs in `points`.
- For a `path`, put the raw SVG 2 command string in `d`. Use uppercase or lowercase `M L H V C S Q T A Z`, repeated argument groups, or compact separators as in SVG. For example, `` makes a closed square. Put `fill-rule="evenodd"` on the path for alternating holes. The default is `nonzero`. Closed paths use the same interior in geometry masks and boolean operands. An empty value gives empty geometry. A malformed value produces a diagnostic for the whole attribute. [Path contract](https://nothing.graphics/docs/format/spec/graphics#path-data) · [Runnable example](https://github.com/gridaco/nothing/blob/main/ncf/examples/path-syntax.nothing)
- Round a rectangle with `corner-radius="12"`. Override any corner with `corner-top-left-radius`, `corner-top-right-radius`, `corner-bottom-right-radius`, or `corner-bottom-left-radius`. An explicit zero keeps that corner square. Key a corner directly on the rectangle. If adjacent corners overlap, all four used radii shrink proportionally while the source values stay editable. [Rectangle corners](https://nothing.graphics/docs/format/spec/graphics#rectangle-corners)
- A `boolean` can occupy the geometry slot. Nest two or more operand shapes directly inside it. Use simple closed contours or live `text` inside its operand shape. Letter counters stay open and overlapping glyphs form one region. [Editable word cutout](https://github.com/gridaco/nothing/blob/main/ncf/conformance/cutout.nothing) In `subtraction`, all later operands cut the first shape. Reordering the cutters preserves the region. In `union`, `intersection`, and `exclusion` (odd coverage), all operands can trade places with the same result. The enclosing shape paints the result. A text operand or geometry mask uses glyph outlines, including their holes, independently of its paints. Each operand stays editable.
## Write a title
```xml
Status READY
.
```
This fragment belongs in a timed scene. Request a family by name. The host supplies available faces and fallback. Pin regular, bold and any fallback faces in the host when reproducing a layout. The font size and family on the text apply through its spans, with local overrides. Each line centers its shaped advance on x = 160. Add `inline-size` to wrap, and `line-height` to choose the baseline step. To color one phrase independently, add a `fill` directly inside its span. Spaces beside declarations inside mixed copy are significant. Indent inside the declaration itself. Only a text or span with no child spans may key its string `value`. Its base comes from literal copy. The span still owns the same key and paint after reflow. [Editable text](https://nothing.graphics/docs/format/spec/text) · [Fonts](https://nothing.graphics/docs/format/spec/fonts)
## Paint a contour or its interior
- Draw the fill first, then sibling strokes from bottom to top. Each stroke follows the same contour and owns its explicit `stroke-width`. Use `stroke-align` of `center`, `inside`, or `outside` on simple closed contours. Open contours use center alignment. Caps (`stroke-linecap`) are butt, round, or square. Joins (`stroke-linejoin`) are miter, round, or bevel. The defaults are butt caps, miter joins, and a `stroke-miterlimit` of 4.
- A fill or stroke owns one or more `paint` children, bottom first. Each paint contains one `solid`, `image`, or `gradient`. Use `color="#RRGGBBAA"` on a solid and a document-relative `href` on an image. For linked SVG artwork use the same `` paint as for a PNG. A shape can use the result as picture or mask coverage. [Example](https://github.com/gridaco/nothing/blob/main/ncf/examples/linked-artwork/scene.nothing) The specimen uses `preserveAspectRatio="xMidYMid slice"` to center and scale the image to cover the geometry bounds. Paint blend modes are `normal` (default), `multiply`, and `screen`. Upper paints blend into the lower paints in encoded sRGB. The bottom paint's mode composites the assembled stack into its destination with the stroke or fill coverage applied once.
- A gradient owns its ordered stops. Use a unit-interval `offset` and `stop-color="#RRGGBBAA"` on each stop. Linear gradients use two endpoints, radial gradients use `cx cy r`, sweep gradients use `cx cy`, and diamond gradients use `cx cy rx ry`. For a linear gradient supply distinct endpoints. For radial and diamond gradients supply positive radii. Linear and radial gradients in local coordinates use `gradientUnits="userSpaceOnUse"`.
Across a gradient, interpolate the encoded sRGB channels and alpha separately between adjacent stops. Extend the endpoint colors beyond the first and last stops. Read stops in source order. At a sample time, an offset below its predecessor takes the predecessor's effective offset. At a shared offset the last stop supplies the color. A single stop paints uniformly and an empty gradient contributes transparent paint.
For a road, put a 12-unit dark stroke and an 8-unit light stroke on one polyline, in that order. They share the bend. To add a highlight of the same width to the light stroke, add a second paint inside it. To widen the casing, edit the dark stroke's width.
To reveal just the light stroke, put `` inside that stroke and animate its `end`. Both endpoints use the contour's local arc length as one unit. For open and compound paths use [0, 1]. A single closed contour accepts unwrapped positions, including negatives. For example, `` paints one continuous band across the seam. Key the head on `end` and the tail on `start`. A span of at least one lap paints the closed stroke once. Equal or crossed endpoints give empty coverage. On a compound path, measure all drawn subpaths in order. Moves consume zero distance. Each selected piece keeps its own caps or closing join. [Contour trim](https://nothing.graphics/docs/format/spec/contour-trim)
## Position and composite the result
A drawable's local origin is (0, 0). The default rectangle is centered there, so changing only its shape's `rotate` turns it in place. A group can place its origin at a hinge and carry its children around it. Editing a child's size leaves the group's pivot in place. [Placement, registration and pivot](https://nothing.graphics/docs/format/spec/boxed-geometry#what-follows-an-edit)
A `group` holds ordered shapes, groups, and placements. Its children share the enclosing clock. A shape, group, or sequence can scale on local axes (`scale-x`, `scale-y`, default 1), then shear horizontally (`skew-x` in degrees, strictly between −90 and 90), then rotate clockwise in degrees (`rotate`), about an explicit local pivot (`pivot-x`, `pivot-y`), then translate along parent axes (`translate-x`, `translate-y`). Pivot, skew, rotation and translation default to zero. Key the group's `opacity` (0 to 1, default 1) to fade overlapping children together.
A shape, group or sequence may own one `mask`. The mask's parent supplies the content. The shape directly inside the mask supplies coverage in the owner's local coordinates. Put the mask anywhere among the owner's children. Its `type` selects the source's filled interior (`geometry`), rendered alpha (`alpha`), or luminance times alpha (`luminance`). Apply mask and opacity once to the assembled picture, then map it into the parent. Put the mask on a parent group and pan its child for a stationary window. Put the mask on the moving placement to carry it along. [Spatial composition](https://nothing.graphics/docs/format/spec/spatial)
## Key a property
Put `animate` directly inside the element that owns the property. Its `attributeName` names that property. Give each track at least two keys in strictly increasing time. Each key has a `value` and exactly one address, such as `frame="12"` or `time="0.5s"`. Changing a scene from 24 to 30 fps moves frame 12 from 0.5s to 0.4s. The time address stays at 0.5s. Preserve the original address when editing a value. A timed scene declares a positive integer or rational frame rate, such as `24` or `30000/1001`.
Give every key except the last an outgoing `ease`. Finite scalars and colors support `hold`, `linear`, and `spline` (with `keySplines="x1 y1 x2 y2"` and controls in [0,1]). Color keys interpolate straight encoded sRGB channels and alpha independently, retaining intermediate precision. Interpolate equal-length `points` lists by coordinate and matching `d` commands by parameter. To change topology, use a hold. Discrete values also use holds. Child order, resource references, placement timing, canvas dimensions, and the scene clock are outside property animation.
Base evaluation uses the authored value or its specified default. Supply any required base attribute even when its owner carries a track. Before the first key a track contributes nothing. The interval from first to last key is one iteration. A positive integer `repeatCount` defaults to 1. At an interior repeat boundary the first key takes effect. After the final iteration, `fill="freeze"` on the animation holds the last value. The default `remove` releases the property. If tracks on one property overlap, the contributing track with the latest start wins. Equal starts use the later declaration.
## Place footage, sound, or a composition
```xml
```
Place a sequence inside a scene, shape, group or inline sequence. Supply one source, either a relative `href` to audio, video, or a scene, or inline content. Both forms require `begin`, positive `dur`, and `source-start`. Write a frame-based cut as `begin="48f" dur="12f"`. Each of these two attributes independently accepts an integer count of frames at the enclosing scene’s authored rate or exact seconds. Preserve each unit on save. The source in-point uses exact seconds, including fractions such as `1/48000s`. The example plays from parent time 2s up to 5s, exclusive. Source time equals `source-start + (parent time - begin)`.
Choose the source around the intended edit. For a backdrop that moves or swaps as one piece, keep its editable artwork in a scene and place that scene once. An edit to the shot then targets the placement, and an edit to the artwork targets the shapes in its source.
Resolve a reference from its declaring file. A movie starts at its native display size. A referenced scene uses its declared canvas, or the enclosing viewport if it omits dimensions. Inline children and referenced content use source time. The placement's own tracks and mask use parent time. Inline content inherits the scene rate. A referenced timed scene declares its own rate. Preserve the exact mapped instant when it falls between that scene's frames. Picture and sound share this mapping. For aligned sample grids and matching channel layouts, sum overlapping audio per channel at each output sample. Key `gain` on the sequence for an audio fade. It is a nonnegative linear multiplier with a base of 1. A compound clip applies its gain once to the mix of its children.
## Scope
For the first SVG interchange case, give both scenes the same fixed viewport. Write `anchor-u="0" anchor-v="0"` and map the SVG rectangle's `x` and `y` to NCF `offset-x` and `offset-y` on the rectangle and keep its `width` and `height`. An opaque SVG `#RRGGBB` color acquires the alpha byte `FF` in NCF. [Rectangle exchange pair](https://github.com/gridaco/nothing/blob/main/ncf/conformance/rectangle.md)
Plain groups pass through. Set blend-mode="normal" on a group to isolate its children, or blend-mode="multiply" to multiply its assembled result. A nonempty source filter always assembles its source on transparency, including at zero sigma. For a blur or an alpha-based shadow, put `blur`, `drop-shadow`, or `inner-shadow` children inside one `filter` on the shape, group or sequence. They run top to bottom and may repeat. To shadow a rectangle independently of its paint, put `box-shadow` directly under its shape. Use `sigma` for Gaussian softness, `dx` and `dy` for offset, and `spread` for box shadows. Use `inset="true"` on a box shadow to shade the interior above the fill. Use `inner-shadow` in a filter to shade the input alpha and preserve transparent holes. For frosted glass, put `` on the panel shape. Its geometry bounds the effect even without fill. Give a group or sequence an explicit mask to bound its backdrop blur. [Image effects](https://nothing.graphics/docs/format/spec/filters)
To study these owners together, edit one panel and a caption in the [moving card](https://github.com/gridaco/nothing/blob/main/ncf/examples/composition-card.nothing) and compare [expected samples](https://github.com/gridaco/nothing/blob/main/ncf/conformance/composition-card.md). An editor can produce timing from a transcript or generate keys from a preset. The scene stores the resulting copy, sources, properties and keys. Automatic fit constraints, selectors over generated lines, arbitrary geometry branches, and host shaders remain open.
## References
Preview a timed scene from the repo root with `cargo run --manifest-path ncf/Cargo.toml -p ncf-preview -- path/to/scene.nothing --frame 24 -o ncf/target/preview.svg`. Use `--time 1/3s` for an exact time. [Supported preview operations](https://github.com/gridaco/nothing/blob/main/ncf/tools/ncf-preview/README.md)
The specification defines authoring behavior. Implementation support records which operations the standalone preview and N4 exercise. [Canonical specimen](https://github.com/gridaco/nothing/blob/main/ncf/examples/canonical-draft.nothing) · [Implementation support](https://nothing.graphics/docs/format/implementation-support)
- [Format layout](https://github.com/gridaco/nothing/blob/main/ncf/README.md)
- [Design doctrine (review draft)](https://github.com/gridaco/nothing/blob/main/ncf/DOCTRINE.md)
- [Keyword table by owner](https://github.com/gridaco/nothing/blob/main/ncf/docs/vocabulary.md)
- [Specifications](https://nothing.graphics/docs/format/spec)
- [SVG ↔ .nothing crosswalk](https://github.com/gridaco/nothing/blob/main/ncf/docs/svg-crosswalk.md)
- [Inline property animation](https://nothing.graphics/docs/format/spec/animation)
- [RFCs and open proposals](https://github.com/gridaco/nothing/blob/main/ncf/rfcs/README.md)
- [Supporting documentation](https://github.com/gridaco/nothing/blob/main/ncf/docs/README.md)
- [Conformance](https://github.com/gridaco/nothing/blob/main/ncf/conformance/README.md)
- [Examples](https://github.com/gridaco/nothing/blob/main/ncf/examples/README.md)
- [Changelog](https://nothing.graphics/docs/format/changelog)
- [Contributing](https://github.com/gridaco/nothing/blob/main/ncf/CONTRIBUTING.md)