Back

SetPosition

Hello World

Change the main app's position and size.

app.SetPosition( left, top, width, height, options )

Mostly used for transparent apps.

Example - SetPosition

function OnStart()
{
    app.SetPosition( 0.2, 0.2, .6, .6 );

    lay = app.CreateLayout( "linear", "VCenter,fillxy" );
    lay.SetBackColor("blue")

    btn = app.CreateButton( "Hello World", 0.3, 0.1 ); // 1, 1 will overflow
    lay.AddChild( btn );

    app.AddLayout( lay );
}
    Copy     Copy All       Run      
number: fraction (0..1)
string: comma “,” separated: “px”