isokit: project layer, Studio GUI, MCP server, viewer, CLI, demo project and docs

This commit is contained in:
grabowski committed 2026-10-22 15:29:07 +07:00
1 parent 95c80ec6b1
commit 564aeb75f6
47 files changed
+5978 -366

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
// A project prefab: shows up as "Gate kiosk" in the Studio palette.
fn meta_kiosk() {
#{ label: "Gate kiosk", category: "Site", icon: "⌂",
help: "A small kiosk with a boom barrier (project prefab, lib/kiosk.rhai).",
props: [
#{ key: "h", type: "float", def: 2.8, min: 2.2, max: 4.0, step: 0.1, label: "Height (m)" },
#{ key: "boom", type: "bool", def: true, label: "Boom barrier" },
#{ key: "boom_len", type: "float", def: 5.0, min: 2.0, max: 8.0, step: 0.5, label: "Boom length (m)" },
] }
}
fn prefab_kiosk(o) {
let p = o.p;
let s = sprite();
s.box(-1.5, -1.2, 1.5, 1.2, 0.0, 0.2, "plinth");
s.box(-1.4, -1.1, 1.4, 1.1, 0.2, p.h, "brick", #{ top: "roof3" });
let sd = sides(-1.4, -1.1, 1.4, 1.1);
s.open(sd.S[0], sd.S[1], [[0.3, 1.5, 1.1, 2.0]], "glass");
s.open(sd.E[0], sd.E[1], [[0.6, 1.4, 0.2, 2.3]], "door2");
if p.boom {
// the boom is its own sprite so cars and people sort around it
let b = sprite();
b.box(1.7, -1.5, 1.95, -1.25, 0.0, 1.0, "boom");
b.box(1.75, -1.5 - p.boom_len, 1.9, -1.45, 0.9, 1.0, "boom");
}
}