examples

ui-button.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Button without position
startBtn = ui.button("Start!")
startBtn.action(() => {
  print("Start! button pressed")
})

// Button with position
postionBtn = ui.button("Left!", { x: 100, y: 100 })
postionBtn.action(() => {
  print("Left! button pressed")
})

// Button with x, y coordinates
postionBtn = ui.button("Right!", 860, 100)
postionBtn.action(() => {
  print("Right! button pressed")
})