UI.Spinner

From GiderosMobile
Revision as of 20:13, 16 October 2023 by MoKaLux (talk | contribs) (Created page with "__NOTOC__ '''Available since:''' Gideros 2023.1<br/> '''Class:''' UI<br/> === Description === Creates a Spinner widget. <syntaxhighlight lang="lua"> UI.Spinner.new(params...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Available since: Gideros 2023.1
Class: UI

Description

Creates a Spinner widget.

UI.Spinner.new(params)

params is a table which can have the following properties:

  • Min: (number) the minimum Spinner widget value
  • Max: (number) the maximum Spinner widget value
  • Step: (number) the Spinner widget steps increment value
  • Format: (string) the Spinner widget text format
  • Looping: (bool) allows the Spinner widget value to loop (default = false)

Parameters

params: (table) the default parameters for the Spinner widget

Example

local gui = UI.Spinner.new({Min=0, Max=100, Step=10, Format="Done: %d%%", Looping=true})
gui:setDimensions(128, 32)
gui:setColor(0xaacc00)
gui:setPosition(50, 50)

function gui:onWidgetChange(w)
	print(w.value)
end

local screen=UI.Screen.new() -- needed to add the Spinner widget arrows
screen:ui(gui)