User Tools

Site Tools


app_methods:setorientation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
app_methods:setorientation [2015/03/26 19:21]
madlyr [app.SetOrientation]
app_methods:setorientation [2015/03/26 19:25]
madlyr
Line 2: Line 2:
 //(Samples taken from the Droidscript documentation)//\\ \\ The **SetOrientation** method forces the screen to either "**Portrait**" or "**Landscape**" orientation. After using this function rotating the phone/tablet will have no effect on the app's orientation.\\ To unlock the orientation call the function again using the orientation "**Default**". The optional **callback** function is invoked after orientation change.  //(Samples taken from the Droidscript documentation)//\\ \\ The **SetOrientation** method forces the screen to either "**Portrait**" or "**Landscape**" orientation. After using this function rotating the phone/tablet will have no effect on the app's orientation.\\ To unlock the orientation call the function again using the orientation "**Default**". The optional **callback** function is invoked after orientation change. 
 <code>app.SetOrientation( orient, callback );</code> <code>app.SetOrientation( orient, callback );</code>
- 
 ====Example==== ====Example====
- 
 <code javascript> <code javascript>
 function OnStart() function OnStart()
Line 24: Line 22:
 </code> </code>
  
-=====app.GetOrientation===== +=====GetOrientation===== 
-The **GetOrientation** method gets the current orientation of the phone/tablet.  It will return either the value "**Portrait**" or the value "**Landscape**".+ 
 +The **GetOrientation** method gets the current orientation of the phone/tablet. It will return either the value "**Portrait**" or the value "**Landscape**". 
 +<code>orient = app.GetOrientation();</code> 
 +====Example====
 <code javascript> <code javascript>
 function OnStart() function OnStart()
Line 33: Line 34:
 } }
 </code> </code>
-=====app.GetDefaultOrientation=====+ 
 +=====GetDefaultOrientation===== 
 The **GetDefaultOrientation** method gets the default (normal) orientation of the device. It will return either the value "**Portrait**" or the value "**Landscape**". The **GetDefaultOrientation** method gets the default (normal) orientation of the device. It will return either the value "**Portrait**" or the value "**Landscape**".
 +<code>orient = app.GetDefaultOrientation();</code>
 +====Example====
 <code javascript> <code javascript>
 function OnStart() function OnStart()
app_methods/setorientation.txt · Last modified: 2015/03/27 03:25 (external edit)