Back

CreateScroller

Scroller creates a Scroller object

app.CreateScroller( width, height, options ) -> app object - Scroller

Example - Example



function OnStart()
{
    lay = app.CreateLayout( "Linear", "FillXY" );

    scroll = app.CreateScroller( 1.0, 1.0 );
    lay.AddChild( scroll );

    layScroll = app.CreateLayout( "Linear", "Left" );
    scroll.AddChild( layScroll );

    img = app.CreateImage( "/Sys/Img/Hello.png", 2.0, 2.0 );
    layScroll.AddChild( img );

    app.AddLayout( lay );
}
    Copy     Copy All       Run      

The following methods are avaiable on the Scroller object:

  Destroy()
  Explode()
  Focus()
  GetAbsHeight() -> number - integer
  GetAbsWidth() -> number - integer
  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 }
  GetScrollX() -> number - fraction of object width
  GetScrollY() -> number - fraction of object width
  GetTop( options ) -> number - fraction of screen height
  GetType() -> string - "Scroller"
  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()
  ScrollBy( x, y )
  ScrollTo( x, y )
  SetScale( x, y )
  Show()
  id -> string - "#id"

unknown
app object - app layout
AddChild
number
set color effects
?
destroys object
DestroyChild
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
GetScrollX
GetScrollY
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
?
number - fraction of object width
add x and y value to current scroll position
override scroll position
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
move object from current position
set surrounding borders
SetPosition
number - factor
SetScale
change object size
string - "Show" or "Hide" or "Gone"
change visibility mode
Set visibility "Show"
?
object id