Back

CreateGame

Hello World
Content:
- Methods

CreateGame automatically turns your app in game mode and adds a GameView control to it.

gam = app.CreateGame( file, orient )

It also applies various settings to your app such like the 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

Example - Demo

function OnStart()
{
    app.CopyFile("/assets/samples/Game_Bounce.js", "script.js");
    app.CreateGame("script.js", "landscape");
}
Copy All       Run      

Methods

The following methods are available on the Game object:

string: path to file or folder ( “/absolute/...” or “relative/...” )
string: “Portrait” or “Landscape”
app object: GameView
app object: Layout
game
lay