game.load

Loads a game into the editor.

Prototype

  1. hGame = game.load ( sGameName )

Description

Games always load with the "current profile" set.


Parameters

sGameName - game name string


Return values

hGame - game handle


Sample

  1. function onStageViewInit ( hView, hComponent, hFile )
  2.  
  3. if ( hFile ) then
  4. if ( project.getFileType( hFile ) == project.kFileTypeGame ) then
  5. local hGame = game.load ( project.getFileName ( hFile ) )
  6. if ( hGame ) then
  7. -- do stuff

Available since ShiVa 2.0