Back

CreateToggle

Toggle creates a toggle button object that allows the user to change a setting between two states.

app.CreateToggle( text, width, height, options ) -> app object - Toggle

The following methods are avaiable on the Toggle object:

  Destroy()
  Explode()
  Focus()
  GetAbsHeight() -> number - integer
  GetAbsWidth() -> number - integer
  GetChecked() -> boolean
  GetHeight( options ) -> number - fraction of screen height
  GetLeft( options ) -> number - fraction of screen width
  GetPosition( options ) -> object - { left: fraction of parent width, top: fraction of parent height, right: fraction of parent width, bottom: fraction of parent height }
  GetText() -> string
  GetTextSize( mode ) -> number
  GetTop( options ) -> number - fraction of screen height
  GetType() -> string - "Toggle"
  GetVisibility() -> string - "Show" or "Hide" or "Gone"
  GetWidth( options ) -> number - fraction of screen width
  Gone()
  Hide()
  IsEnabled() -> boolean
  IsOverlap( obj, depth ) -> boolean
  IsVisible() -> boolean
  Release()
  SetScale( x, y )
  SetText( text )
  Show()
  id -> string - "#id"

string
number - fraction of screen width
number - fraction of screen height
unknown
number
set color effects
?
destroys object
destroys object with explode animation and sound
?
get height in pixels
get width in pixels
GetChecked
get screen relative height
get distance to left parent border
GetText
GetTextSize
get distance to upper parent border
GetType
GetVisibility
get screen relative width
Set visibility "Gone"
Set visibility "Hide"
IsEnabled
app object
return wether obj overlap with an other
IsVisible
?
string -
  hexadecimal: "#rrggbb", "#aarrggbb"
  colourName: "red", "green", ...
SetBackColor
SetBackColorRadial
string - path to file or folder ( "/absolute/..." or "relative/..." )
changes the background image
boolean
SetChecked
string - "Add" or "Multiply" or "?"
adjust color
en/disable object
move object from current position
function( event )
called when user touches object
set surrounding borders
SetPosition
number - factor
SetScale
change object size
number - integer
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 ]
}