examples

button-state.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
lbl = ui.label("See me!", display.width/2, 100)

btn = ui.button("🔥 Click me!")
btn.cornerRadius=10
btn.action((event) => {
  print("Click me!", event.phase)
  
  lbl.active = !lbl.active
  act.active = !act.active
})

act = ui.button("State change!", display.width/2, 500)
act.cornerRadius=10
act.action((event) => {
  print("State change!", event.phase)
  
  lbl.active = !lbl.active
  btn.active = !btn.active
})