<scene>
Declare the canvas, clock, views and root drawing order of a complete document.
Examples
Download the complete .nothing source · Source on GitHub
Rendered with ncf-preview at 64 × 64.

<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>Use one unnamespaced <scene> root in a UTF-8 XML 1.0 file. Drawables paint over the scene background in source order.
Syntax
Give a still its own canvas
Set both canvas dimensions to 64. With no scene background, the terracotta rectangle at x = 8–48 and y = 8–48 appears on transparency.
<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>Complete .nothing source · Sample checks
Usage context
Use this element as the single document root.
Unknown elements, declarations of a DTD, and processing instructions require a diagnostic. Opaque extension attributes survive unrelated edits. A standalone sample needs a resolved viewport. Supply a frame rate when any placement or track is present.
Attributes
width
Value scene units · Keys Static
Positive finite canvas width. Canvas dimensions are supplied together. With both omitted, use the caller's viewport. Canvas and clock
height
Value scene units · Keys Static
Positive finite canvas height. Canvas dimensions are supplied together. With both omitted, use the caller's viewport. Canvas and clock
background
Value #RRGGBBAA · If omitted #00000000 · Keys Color channels
Fill the resolved viewport once beneath the artwork, using eight hexadecimal digits in RGBA order. Canvas and clock
frame-rate
Value Positive integer or ratio of two positive integers in frames per second, such as 24 or 30000/1001 · Keys Static
Authored clock rate. Required if there is a placement or property track anywhere in the document. Canvas and clock
camera
Value Case-sensitive camera ID · Keys Held
Choose the scene's base view. Required when the scene has camera declarations. With no cameras use the identity view. 2D cameras
meters-per-unit
Value meters per scene unit · If omitted 0.001 · Keys Static
Spatial trial. Positive metric scale for the spatial trial. Proposed focus settings
Children
| Elements | Cardinality | Declared by | Role and source order |
|---|---|---|---|
<shape>, <group>, <sequence> | Zero or more | <scene> | Root drawables in a Level 1 scene. Document order from bottom to top. |
<camera> | Zero or more | <scene> | Named cameras. Supply a base camera ID when any are present. Declarations occupy no paint slot. 2D cameras |
<plane> | Zero or more | <scene> | Spatial trial. Planes are the root drawables in a spatial trial scene. Depth order from far to near per ray. At equal depth the later plane paints over the earlier one. Use planes instead of direct Level 1 drawables with the spatial projection. Proposed plane authoring and depth |
<animate> | Zero or more | Animation | A track targets one keyable property on this owner. For equal first-key times, the later track in document order wins. Evaluating animation tracks |