Components
imagerequires: element.imageicon: imageA picture or an animation: background, decorations, characters. Not interactive; only actions that point to it change it.
Roles: — · Events: —
| Option | Key | Type | Required | Default | requires |
|---|---|---|---|---|---|
| Position and size | rect | rect | yes | [0,0,200,200] | — |
| Layer | layer | number | no | 1 | — |
| Appearance | visual | visual (image, animation) | yes | — | — |
textrequires: element.texticon: textA caption: an instruction, a label or a message. Not interactive; only actions that point to it change it.
Roles: — · Events: —
| Option | Key | Type | Required | Default | requires |
|---|---|---|---|---|---|
| Position and size | rect | rect | yes | [0,0,400,80] | — |
| Layer | layer | number | no | 1 | — |
| Appearance | visual | visual (text) | yes | — | — |
componentrequires: element.componenticon: pointerAn element the player interacts with: click, pick up and drop (on a Target or loose on the scene).
Roles: clickabledraggableconnectable · Events: tapdrag-startdrag-enddropdrop-outsidecorrectwrong
| Option | Key | Type | Required | Default | requires |
|---|---|---|---|---|---|
| Position and size | rect | rect | yes | [0,0,200,200] | — |
| Layer | layer | number | no | 1 | — |
| Appearance | visual | visual (image, animation, text) | yes | — | — |
| Clickable | clickable | bool | no | false | component.clickable |
| Draggable | draggable | object (bounds, hit) | no | — | component.draggable |
| Connectable | connectable | bool | no | false | component.connectable |
Line anchor point (only when connectable: true) | anchor | object (point in rect, reach) | no | — | component.anchor |
containerrequires: element.containericon: containerHolds Components: arranges them vertically, horizontally or in tiles; children can be taken out and put back. Invisible without an appearance.
Roles: contains · Events: child-addedchild-removed
| Option | Key | Type | Required | Default | requires |
|---|---|---|---|---|---|
| Position and size | rect | rect | yes | [0,0,600,160] | — |
| Layer | layer | number | no | 1 | — |
| Appearance | visual | visual (image, animation, text) | no | — | — |
| Layout | layout | object (orientation, columns, gap, padding, align, order, overflow) | no | {"orientation":"vertical"} | container.layout |
| Components inside | children | refList (element: component) | no | — | container.children |
targetrequires: element.targeticon: targetA place where the player drops Components. Invisible without an appearance.
Roles: accepts · Events: over-targetleft-targetoccupiedvacateddropcorrectwrong
| Option | Key | Type | Required | Default | requires |
|---|---|---|---|---|---|
| Position and size | rect | rect | yes | [0,0,200,200] | — |
| Layer | layer | number | no | 1 | — |
| Appearance | visual | visual (image, animation, text) | no | — | — |
| Capacity | capacity | number | many | no | 1 | target.capacity |
| Hit detection | hitMode | object (mode, overlap, radius) | no | {"mode":"center"} | target.hitMode |
| Placement after a hit | snap | object (mode, point) | no | {"mode":"center"} | target.snap |
| When full | onOccupied | choice (reject, replace, swap) | no | "reject" | target.onOccupied |