User Tools

Site Tools


built_in:set_screen_mode

Differences

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

Link to this comparison view

built_in:set_screen_mode [2015/03/26 20:29]
madlyr created
built_in:set_screen_mode [2016/09/02 15:18]
Line 1: Line 1:
-=====SetScreenMode===== 
  
-====Description==== 
- 
-The **SetScreenMode** method sets the screen **mode**. It could be full screen mode "Full" or normal screen mode  "Normal" or "Default" 
-<code> app.SetScreenMode( mode );</code> 
- 
----- 
- 
-====Example==== 
- 
-<code javascript> 
- 
-//Called when application is started. 
-function OnStart() 
-{ 
- //Create a layout with objects vertically centered. 
- lay = app.CreateLayout( "Linear", "Vertical,VCenter,FillXY" );  
- 
- btnFull = app.CreateButton( "Set full screen", 0.5, 0.1 ); 
- btnFull.SetMargins( 0, 0.05, 0, 0.05 ); 
- lay.AddChild( btnFull ); 
- 
- btnNormal = app.CreateButton( "Set full screen", 0.5, 0.1 ); 
- btnNormal.SetMargins( 0, 0.05, 0, 0.05 ); 
- lay.AddChild( btnNormal ); 
-  
- //Set function to call when button pressed. 
- btnFull.SetOnTouch( btn_OnFullTouch ); 
- btnNormal.SetOnTouch( btn_OnNormalTouch ); 
-  
- //Add layout to app.  
- app.AddLayout( lay );      
-} 
- 
-function btn_OnFullTouch() 
-{ 
-    app.SetScreenMode( "Full" ); 
-} 
- 
-function btn_OnNormalTouch() 
-{ 
-    app.SetScreenMode( "Normal" ); 
-} 
- 
-</code> 
built_in/set_screen_mode.txt ยท Last modified: 2016/09/02 15:18 (external edit)