Back

SetOrientation

Hello World

Set the display orientation to a fixed value.

app.SetOrientation( orient, callback )

You can unlock it again passing “Default” as orientation.

See Also: GetOrientation

Example - Change Orientation

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

    spn = app.CreateSpinner( "Default,Landscape,ReverseLandscape,Portrait,ReversePortrait", 0.3, 0.1 );
    spn.SetOnChange( SetOrientation );
    lay.AddChild( spn );

    app.AddLayout( lay );
}

function SetOrientation( orient )
{
    app.SetOrientation( orient )
}
    Copy     Copy All       Run      
string: “Default” or “Landscape” or “ReverseLandscape” or “Portrait” or “ReversePortrait”
function()