Writing it
dirt {
slope "30deg"
pin top="$dirtEdgeHeight" at=edges // exact at every rim
pin knollTop top="$groundHeight + 4dmm" at=knoll // a point
pin top="[$waterBedHeight .. $groundHeight + 1dmm]" at=banks // anywhere from the bed to the land
pin top="[$waterBedHeight .. $waterBedHeight + 0.3dmm]" at=bed // later, so it wins inside the bed
}
Reference
| Written | Takes | What it does |
|---|---|---|
pin NAME | a name | Optional, for messages. |
top= | a height or a range | The band at the place: a single height holds it exactly; a range [low .. high] leaves the body free inside it; a weighted range is a cloud of its own, rolled with the body's roll, and replaces the body's cloud where the pin holds (see Clouds). Required. In it, $x and $y are where the point is on the tile and $d and $a are its place in the body's own region, so a pin along an edge can be a function along the edge. |
at= | any place | A name or a literal point ("(50%, 50%)"); a point, a line or a region. A literal point is in the frame of the body's region, and one outside it is dt::point. Required. |
Notes
Pins go inside a body's block (dirt, water, cliff, flagstones, planks). Where pins overlap, the later one wins. The library's defaults are read before the tile, so a pin the tile writes always wins over a default. A pin says where and how high, nothing else: how the body meets it is the body's (dirt eases toward it no steeper than its slope, water settles over 9 mm, cliffs and floors step).
check solves the bands and notes what it finds: a pin that wins nowhere because later pins cover all of its place (dt::shadowed), dirt forced steeper than its slope (dt::steep, with both heights and the distance), a pin whose place is empty (dt::empty, refused), and a stretch where the tile's own pins move the rim off the library's edge height (dt::edge). check --explain gives each pin's share of its place where it wins.
Seen from the language
The guide pages that use pin: Heights, Defaults and the edge contract, Clouds.