Reference · The realistic Earth's pure parts
readBodyLabelfunction
What the family's attributes mean: body-label (painted, etched, outline or burned; present with another value, or none, it is painted; absent, no label), body-label-strength (0 to 1, 0.5), body-label-repeat (once, both or
around; once), body-label-latitude (degrees; 0), body-label-facing (present: always facing the reader), body-label-font and body-label-fallback-font.
Import it
import { readBodyLabel } from "@johnmorrisdotca/chikyu-earth/realistic";
Definition
function readBodyLabel(get: (name: string) => string | null): BodyLabelSettings | null
Parameters
| Name | Type | Description |
|---|---|---|
get | (name: string) => string | null | Reads an attribute by name, |
Returns
BodyLabelSettings | null
The settings, or null for no label.
Examples
import { readBodyLabel } from "@johnmorrisdotca/chikyu-earth/realistic";
const attributes: Record<string, string> = { "body-label": "etched", "body-label-strength": "0.8", "body-label-repeat": "both" };
console.log(readBodyLabel((name) => attributes[name] ?? null));{
look: 'etched',
strength: 0.8,
repeat: 'both',
latitude: 0,
facing: false
}What it prints (run when this page was built)