This shows you the differences between two versions of the page.
app_methods:setorientation [2015/03/26 19:21] madlyr [app.SetOrientation] |
app_methods:setorientation [2015/03/27 03:25] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | =====SetOrientation===== | ||
- | //(Samples taken from the Droidscript documentation)// | ||
- | < | ||
- | ====Example==== | ||
- | |||
- | <code javascript> | ||
- | function OnStart() | ||
- | { | ||
- | app.SetOrientation( " | ||
- | |||
- | lay = app.CreateLayout( " | ||
- | txt = app.CreateText( " | ||
- | txt.SetTextSize( 32 ); | ||
- | lay.AddChild( txt ); | ||
- | app.AddLayout( lay ); | ||
- | } | ||
- | |||
- | function OnOrientationChanged() | ||
- | { | ||
- | app.ShowPopup( " | ||
- | } | ||
- | |||
- | </ | ||
- | |||
- | =====app.GetOrientation===== | ||
- | The **GetOrientation** method gets the current orientation of the phone/ | ||
- | <code javascript> | ||
- | function OnStart() | ||
- | { | ||
- | orient = app.GetOrientation(); | ||
- | app.ShowPopup( orient ); | ||
- | } | ||
- | </ | ||
- | =====app.GetDefaultOrientation===== | ||
- | The **GetDefaultOrientation** method gets the default (normal) orientation of the device. It will return either the value " | ||
- | <code javascript> | ||
- | function OnStart() | ||
- | { | ||
- | orient = app.GetDefaultOrientation(); | ||
- | app.ShowPopup( orient ); | ||
- | } | ||
- | </ |