UI.Slider

From GiderosMobile
Revision as of 00:37, 16 October 2023 by MoKaLux (talk | contribs) (Created page with "__NOTOC__ '''Available since:''' Gideros 2023.1<br/> '''Class:''' UI<br/> === Description === Creates Slider widgets. The widget can be a '''Slider''', or an '''ArcSlider...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Available since: Gideros 2023.1
Class: UI

Description

Creates Slider widgets. The widget can be a Slider, or an ArcSlider.

UI.Slider.new(direction,svgpath,resolution,dual,offset)
UI.ArcSlider.new(astart,aend,resolution,dual,offset)

Parameters

direction: (bool) is the Slider widget vertical default = true
svgpath: (string) the Slider widget svg path
resolution: (number) the Slider widget step increment
dual: (bool) has the Slider widget two knobs default = false
offset: (number) the Slider widget knob offset
astart: (number) the Slider widget start angle value
aend: (number) the Slider widget end angle value

Examples

A Slider

local gui = UI.Slider.new(false, nil, 0.25, true)
gui:setDimensions(256, 32)
--gui:setVertical(false)
gui:setColor(0xaa0000)
gui:setPosition(50, 50)
--gui:setResolution(0.25)
gui:setCenter(0.25)
gui:setKnobPosition(0.25)

stage:addChild(gui)

An ArcSlider

local gui = UI.ArcSlider.new(5, 60, 0.1, true, 0.1)
gui:setDimensions(128, 128)
--gui:setVertical(false)
gui:setColor(0xaa0000)
gui:setPosition(50, 50)
--gui:setResolution(0.25)
--gui:setCenter(0.25)
--gui:setKnobPosition(0.25)

stage:addChild(gui)