This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
app_methods:setorientation [2015/02/22 10:03] octazid created |
app_methods:setorientation [2015/03/27 03:25] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | =====app.SetOrientation===== | + | =====SetOrientation===== |
- | (Samples taken from the Droidscript documentation)\\ \\ The **SetOrientation** method forces the screen to either " | + | //(Samples taken from the Droidscript documentation)//\\ \\ The **SetOrientation** method forces the screen to either " |
+ | < | ||
+ | ====Example==== | ||
<code javascript> | <code javascript> | ||
function OnStart() | function OnStart() | ||
{ | { | ||
- | app.SetOrientation( " | + | app.SetOrientation( " |
lay = app.CreateLayout( " | lay = app.CreateLayout( " | ||
Line 11: | Line 13: | ||
lay.AddChild( txt ); | lay.AddChild( txt ); | ||
app.AddLayout( lay ); | app.AddLayout( lay ); | ||
- | }</ | + | } |
- | =====app.GetOrientation===== | + | function OnOrientationChanged() |
- | The **GetOrientation** method gets the current orientation of the phone/ | + | { |
+ | app.ShowPopup( " | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | =====GetOrientation===== | ||
+ | |||
+ | The **GetOrientation** method gets the current orientation of the phone/ | ||
+ | < | ||
+ | ====Example==== | ||
<code javascript> | <code javascript> | ||
function OnStart() | function OnStart() | ||
{ | { | ||
orient = app.GetOrientation(); | orient = app.GetOrientation(); | ||
+ | app.ShowPopup( orient ); | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | =====GetDefaultOrientation===== | ||
+ | |||
+ | The **GetDefaultOrientation** method gets the default (normal) orientation of the device. It will return either the value " | ||
+ | < | ||
+ | ====Example==== | ||
+ | <code javascript> | ||
+ | function OnStart() | ||
+ | { | ||
+ | orient = app.GetDefaultOrientation(); | ||
app.ShowPopup( orient ); | app.ShowPopup( orient ); | ||
} | } | ||
</ | </ |