wip(0.S2): migrate - a var nothing writes becomes a let; a state is keyed by its module, directory or program, so every program's plan agrees; paths normalized; program states named SceneDemoState / scene_demo_st; the LSP reads state, mut and entry/handler parameters
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3eda72e8c2
commit
5ffe50ed02
463 changed files with 72045 additions and 67421 deletions
|
|
@ -4,29 +4,29 @@ import "ludic.ui"
|
|||
import "ui_scroll_hold_parts/Held.ludic"
|
||||
program UiScrollHold {
|
||||
numbers float
|
||||
function frame(ui_st: mut UiState, x: float, y: float, wheel: float) -> UiNode {
|
||||
function frame(x: float, y: float, wheel: float) -> UiNode {
|
||||
let i = new UiInput
|
||||
i.x = x
|
||||
i.y = y
|
||||
i.wheel = wheel
|
||||
ui_input(ui_st, i)
|
||||
ui_show(ui_st, "Held", null, 0.0, 0.0, 400.0, 600.0)
|
||||
let root: UiNode = ui_nodes(ui_st, "Held", null)
|
||||
ui_place(ui_st, root, 0.0, 0.0, 400.0, 600.0)
|
||||
ui_input(i)
|
||||
ui_show("Held", null, 0.0, 0.0, 400.0, 600.0)
|
||||
let root: UiNode = ui_nodes("Held", null)
|
||||
ui_place(root, 0.0, 0.0, 400.0, 600.0)
|
||||
return root.children[0]
|
||||
}
|
||||
function at(p: UiNode) -> string { return `{int(p.children[0].scroll_y)} {int(p.children[1].scroll_y)} {int(p.children[2].scroll_y)} {p.children[3].text}` }
|
||||
entry (ui_st: mut UiState) {
|
||||
ui_backend(ui_st, new UiBackend)
|
||||
let p = frame(ui_st, -1.0, -1.0, 0.0)
|
||||
let first = at(frame(ui_st, -1.0, -1.0, 0.0))
|
||||
frame(ui_st, p.children[0].x + 5.0, p.children[0].y + 5.0, 1.0)
|
||||
let followed = at(frame(ui_st, -1.0, -1.0, 0.0))
|
||||
frame(ui_st, p.children[1].x + 5.0, p.children[1].y + 5.0, -1.0)
|
||||
let fixed = at(frame(ui_st, -1.0, -1.0, 0.0))
|
||||
ui_scroll_set(ui_st, "free", 70.0)
|
||||
let set = at(frame(ui_st, -1.0, -1.0, 0.0))
|
||||
frame(ui_st, p.children[2].x + 5.0, p.children[2].y + 5.0, 1.0)
|
||||
print(`{first} | {followed} | {fixed} | {set} | {at(frame(ui_st, -1.0, -1.0, 0.0))}`)
|
||||
entry {
|
||||
ui_backend(new UiBackend)
|
||||
let p = frame(-1.0, -1.0, 0.0)
|
||||
let first = at(frame(-1.0, -1.0, 0.0))
|
||||
frame(p.children[0].x + 5.0, p.children[0].y + 5.0, 1.0)
|
||||
let followed = at(frame(-1.0, -1.0, 0.0))
|
||||
frame(p.children[1].x + 5.0, p.children[1].y + 5.0, -1.0)
|
||||
let fixed = at(frame(-1.0, -1.0, 0.0))
|
||||
ui_scroll_set("free", 70.0)
|
||||
let set = at(frame(-1.0, -1.0, 0.0))
|
||||
frame(p.children[2].x + 5.0, p.children[2].y + 5.0, 1.0)
|
||||
print(`{first} | {followed} | {fixed} | {set} | {at(frame(-1.0, -1.0, 0.0))}`)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue