Back

AddDrawer

AddDrawer adds layout as drawer on a given side. If the user swipes from one side to the other, the layout will slide out.

app.AddDrawer( layout, side, width )

Example - left



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

    txt1 = app.CreateText( "<-- swipe" );
    txt1.SetTextSize( 30 );
    lay.AddChild( txt1 );

    app.AddLayout( lay );

    layDrawer = app.CreateLayout( "Linear", "VCenter" );
    layDrawer.SetBackground( "/Sys/Img/BlueBack.png" );

    txt2 = app.CreateText( "Hello" );
    txt2.SetTextSize( 40 );
    layDrawer.AddChild( txt2 );

    app.AddDrawer( layDrawer, "left", 0.8 );
}
    Copy     Copy All       Run      

app object - app layout
string - "left" or "right"
number - fraction of screen width