Skip to content

SpinBox: Examples

Damian edited this page Apr 27, 2023 · 1 revision

Enough with the jibber jabber, make with the code

Ok fair enough.

Basic spinbox, -5 to 5 integers with a delta of 1

local sb = require("MDK.spinbox")
testSB = sb:new({
  name = "testsb",
  height = 30,
  width = 40,
  x = 100,
  y = 400,
  color = "dark_green",
  min = -5,
  max = 5,
  delta = 1,
  integer = true,
})

0 to 1, floats, delta of 0.1

testSB = sb:new({
  name = "testsb",
  height = 30,
  width = 40,
  x = 100,
  y = 400,
  color = "firebrick",
  min = 0,
  max = 1,
  delta = 0.1,
  integer = false,
})

0 to 10, integers, delta 1, funky button colors

testSB = sb:new({
  name = "testsb",
  height = 30,
  width = 40,
  x = 100,
  y = 400,
  color = "DarkOrange",
  activeButtonColor = "plum",
  inactiveButtonColor = "purple",
  min = 0,
  max = 10,
  delta = 1,
  integer = true,
})

Clone this wiki locally