Content:
- Methods

CreateGame automatically turns your app in game mode and adds a GameView control to it which loads the referenced script.

gam = app.CreateGame( file, orient )

It also applies various settings to your app such like orientation, ScreenMode(“Game”) and PreventScreenLock(true).
You can still access the GameView and the layout where it was added to via gam.game and gam.lay

Note: If you want to have more control over the GameView control use CreateGameView directly.

You can also put the cfg.Game flag at the top level of your script to write the game code immediately in your main script.

Example - Game_Bounce.js click to expand contents 

Example - Demo click to expand contents 

Methods

The following methods are available on the Game object:

gameapp object: Game
layapp object: Layout