Back

ShowDebug

Hello World

Show/Hide the debug console as black overlay in your app.

app.ShowDebug( show, options )

See Also: Debug, IsDebugVisible

Example - Debug Overlay

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

    tgl = app.AddToggle( lay, "Toggle Debug", -1, 0.1 );
    tgl.SetOnTouch( ShowDebug );

    app.AddLayout( lay );
}

function ShowDebug( show )
{
    app.ShowDebug( show );
}
    Copy     Copy All       Run      

Example - Debug Dialog

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

    tgl = app.AddButton( lay, "Show Debug Dialog", -1, 0.1 );
    tgl.SetOnTouch( ShowDebug );

    app.EnableBackKey( false );
    app.AddLayout( lay );
}

function ShowDebug()
{
    app.ShowDebug( true, "dialog" );
    app.ShowPopup( "Press [BACK] to close." );
}

function OnBack()
{
    if( app.IsDebugVisible() ) {
        app.ShowDebug( false );
    }
}
    Copy     Copy All       Run      
Boolean
String: “dialog-Show the debug log as black overlay dialog” or “clear-Clear content before showing”