Spinner creates a Spinner object to allow user to select an item from a specified list.
Example - Example
function OnStart()
{
lay = app.CreateLayout( "Linear", "VCenter,FillXY" );
spin = app.CreateSpinner( "Bilbo,Frodo,Gandalf", 0.4 );
spin.SetOnChange( ShowSelection );
spin.SelectItem( "Frodo" );
lay.AddChild( spin );
app.AddLayout( lay );
}
function ShowSelection( item )
{
app.ShowPopup( "Selected = " + item );
}
The following methods are avaiable on the Spinner object:
GetPosition(
options ) ->
object - { left: fraction of parent width, top: fraction of parent height, right: fraction of parent width, bottom: fraction of parent height }
unknown
number
set color effects
?
destroys object
destroys object with explode animation and sound
?
get height in pixels
get width in pixels
get screen relative height
get distance to left parent border
GetText
GetTextSize
get distance to upper parent border
GetVisibility
get screen relative width
Set visibility "Gone"
Set visibility "Hide"
IsEnabled
app object
number - fraction of screen width
return wether obj overlap with an other
IsVisible
?
string
SelectItem
string -
hexadecimal: "#rrggbb", "#aarrggbb"
colourName: "red", "green", ...
SetBackColor
number - fraction of screen height
SetBackColorRadial
string - path to file or folder ( "/absolute/..." or "relative/..." )
changes the background image
string - "Add" or "Multiply" or "?"
adjust color
boolean
en/disable object
string - comma separated
override list
move object from current position
function()
called when selection changed
called when user touches object
set surrounding borders
SetPosition
number - factor
SetScale
change object size
SetText
change text str_col
SetTextSize
string - "Show" or "Hide" or "Gone"
change visibility mode
Set visibility "Show"
?
object id
{
source:
app object,
action:
string - "Down" or "Move" or "Up",
count:
number - integer,
X:
number - fraction of screen width,
Y:
number - fraction of screen height,
x:
list - [
x1,
x2,
x3 ],
y:
list - [
y1,
y2,
y3 ]
}