Blueprints and Creates
Two words power most of LumiDSL:
imaginedeclares a blueprint, the template of a shape or scene.createinstantiates it, stamping out a copy on stage with overrides.
Quote either name with double quotes when it contains spaces.
imagine tile
shape: rectangle
size: (120, 80)
fill: "#20242d"
create tile as first with position: (120, 100)
create tile as second with position: (280, 100)One blueprint, two tiles. Inline overrides use with; block overrides don't.
imagine "title card"
shape: rectangle
create "title card" as "opening card"
imagine tile
shape: rectangle
create tile as card
position: (120, 100)
scale: 1.2Creates can nest, forming a transform hierarchy: a child's position is local to its parent after resolution.
imagine square
shape: rectangle
size: (40, 40)
create square as parent
position: (100, 100)
create square as child
position: (50, 0)Blueprints can hold local defines, nested blueprints, and create statements.
Asset defines can point at SVG, image, font, and .lumi paths. SVG and .lumi
defines can also be instantiated directly; a .lumi instance stays a
placeholder until the active asset provider loads and expands the referenced
file.
define logo: "logo.svg"
create logo as mark
define intro: "intro.lumi"
create intro as nestedScene