Open Game Engine 2D API
 All Functions Variables
Functions
Scene

Functions

void OGE_FreezeSprites (bool bValue)
 Freeze or resume player and NPC sprites in current scene.
int OGE_SetSceneMap (int iSceneId, string sNewMap, int iNewLeft, int iNewTop)
 Set the map of the scene.
int OGE_FindSceneSpr (int iSceneId, string sSprName)
 Find a sprite by name in a scene.
int OGE_GetFocusSpr ()
 Get the focus sprite of current scene.
int OGE_GetModalSpr ()
 Get the modal sprite of current scene.
void OGE_SetFocusSpr (int iSprId)
 Set the focus sprite of current scene.
void OGE_SetModalSpr (int iSprId)
 Set the modal sprite of current scene.
int OGE_GetMouseSpr ()
 Get the mouse sprite of current scene.
void OGE_SetMouseSpr (int iSprId)
 Set the mouse sprite of current scene.
int OGE_GetFirstSpr ()
 Get the first sprite of current scene.
void OGE_SetFirstSpr (int iSprId)
 Set the first sprite of current scene.
int OGE_GetLastSpr ()
 Get the last sprite of current scene.
void OGE_SetLastSpr (int iSprId)
 Set the last sprite of current.
int OGE_GetProxySpr ()
 Get the proxy sprite of current.
void OGE_SetProxySpr (int iSprId)
 Set the proxy sprite of current scene.
int OGE_GetTopZ ()
 Get the max value of the z coordinate of the sprites in current scene.
int OGE_BringSprToTop (int iSprId)
 Bring the sprite to the top layer of current scene.
int OGE_GetSceneSpr (int idx)
 Get a sprite in current scene by index.
int OGE_GetDefaultPlayerSpr ()
 Get the default player sprite in current scene.
void OGE_SetDefaultPlayerSpr (int iSprId)
 Set the default sprite in current scene.
int OGE_GetSceneLightMap (int iSceneId)
 Get the light map image of the scene.
int OGE_SetSceneLightMap (int iSceneId, int iImageId, int iLightMode)
 Set the light map of the scene.
bool OGE_OpenSceneTimer (int iInterval)
 Open the timer of current scene.
void OGE_CloseSceneTimer ()
 Close the timer of current scene.
int OGE_GetSceneTimerInterval ()
 Get the interval of the timer of current scene.
bool OGE_IsSceneTimerWaiting ()
 Check if the timer of current scene is working or not.
int OGE_GetScenePlot ()
 Get the ID of the plot sprite of current scene.
int OGE_GetSceneCustomData (int iSceneId)
 Get the custom data of the scene.
void OGE_SetSceneCustomData (int iSceneId, int iGameDataId, bool bOwnIt)
 Set the custom data of the scene.
int OGE_SetSceneBgMusic (int iSceneId, string sMusicName)
 Set background music of current scene.
int OGE_PlayBgMusic (int iLoopTimes)
 Play the background music.
int OGE_GetSceneSprCount (int iSceneId, int iState)
 Get the count of all the sprites with special state in the scene.
int OGE_GetSceneSprByIndex (int iSceneId, int iIndex, int iState)
 Get the sprite with special state in the scene by index.
int OGE_GetSceneCount ()
 Get the count of all the scenes.
int OGE_GetSceneByIndex (int iIndex)
 Get the scene by index.
int OGE_GetSprForScene (int iSceneId, string sSprName, string sClassName)
 Create a sprite with specified template, and add it to the scene.
int OGE_RemoveSprFromScene (int iSceneId, int iSprId)
 Remove a sprite from the scene.
void OGE_RemoveScene (string sName)
 Remove a scene by name.
int OGE_GetScene ()
 Get current scene.
int OGE_GetActiveScene ()
 Get current active scene.
int OGE_GetLastActiveScene ()
 Get the last active scene.
int OGE_GetNextActiveScene ()
 Get the next active scene.
int OGE_GetSceneByName (string sSceneName)
 Get the scene by name.
int OGE_FindScene (string sSceneName)
 Find the scene by name.
string OGE_GetSceneName (int iSceneId)
 Get the name of the scene.
string OGE_GetSceneChapter (int iSceneId)
 Get the chapter name of the scene.
void OGE_SetSceneChapter (int iSceneId, string sChapterName)
 Set the chapter name of the scene.
string OGE_GetSceneTag (int iSceneId)
 Get the tag name of the scene.
void OGE_SetSceneTag (int iSceneId, string sTagName)
 Set the tag name of the scene.
int OGE_GetSceneGameData (int iSceneId)
 Get the default data of the scene.
string OGE_GetSceneBgMusic (int iSceneId)
 Get the background music name of the scene.
int OGE_GetSceneTime ()
 Get the elapsed time of the scene.
int OGE_CallScene (string sSceneName)
 Jump to next scene by name.
int OGE_SetSceneFadeIn (int iSceneId, int iType, int iSpeed)
 Set the fade in action of the scene.
int OGE_SetSceneFadeOut (int iSceneId, int iType, int iSpeed)
 Set the fade out action of the scene.
int OGE_SetSceneFadeMask (int iSceneId, int iImageId)
 Set the mask image for the transaction effect in fade-in fade-out.

Function Documentation

int OGE_BringSprToTop ( int  iSprId)

Bring the sprite to the top layer of current scene.

Parameters:
[in]iSprIdThe ID of the sprite
Returns:
The z coordinate of the sprite
int OGE_CallScene ( string  sSceneName)

Jump to next scene by name.

Parameters:
[in]sSceneNameThe name of next scene
Returns:
Return a non-negative number if succeed
int OGE_FindScene ( string  sSceneName)

Find the scene by name.

Parameters:
[in]sSceneNameThe name of the scene
Returns:
The ID of the scene
int OGE_FindSceneSpr ( int  iSceneId,
string  sSprName 
)

Find a sprite by name in a scene.

Parameters:
[in]iSceneIdThe ID of the scene
[in]sSprNameThe name of the sprite
Returns:
The ID of the sprite
void OGE_FreezeSprites ( bool  bValue)

Freeze or resume player and NPC sprites in current scene.

Parameters:
[in]bValueIf true then freeze the sprites else unfreeze them

Get current active scene.

Returns:
The ID of the active scene

Get the default player sprite in current scene.

Returns:
The ID of the sprite
int OGE_GetFirstSpr ( )

Get the first sprite of current scene.

Returns:
The ID of the sprite
int OGE_GetFocusSpr ( )

Get the focus sprite of current scene.

Returns:
The ID of the sprite

Get the last active scene.

Returns:
The ID of the last active scene
int OGE_GetLastSpr ( )

Get the last sprite of current scene.

Returns:
The ID of the last sprite
int OGE_GetModalSpr ( )

Get the modal sprite of current scene.

Returns:
The ID of the sprite
int OGE_GetMouseSpr ( )

Get the mouse sprite of current scene.

Returns:
The ID of the sprite

Get the next active scene.

Returns:
The ID of the next active scene
int OGE_GetProxySpr ( )

Get the proxy sprite of current.

Returns:
The ID of the sprite
int OGE_GetScene ( )

Get current scene.

Returns:
The ID of current scene
string OGE_GetSceneBgMusic ( int  iSceneId)

Get the background music name of the scene.

Parameters:
[in]iSceneIdThe ID of the scene
Returns:
The name of the background music
int OGE_GetSceneByIndex ( int  iIndex)

Get the scene by index.

Parameters:
[in]iIndexThe index of the scene
Returns:
The ID of the scene
int OGE_GetSceneByName ( string  sSceneName)

Get the scene by name.

Parameters:
[in]sSceneNameThe name of the scene
Returns:
The ID of the scene
string OGE_GetSceneChapter ( int  iSceneId)

Get the chapter name of the scene.

Parameters:
[in]iSceneIdThe ID of the scene
Returns:
The name of the chapter

Get the count of all the scenes.

Returns:
The count of all the scenes
int OGE_GetSceneCustomData ( int  iSceneId)

Get the custom data of the scene.

Parameters:
[in]iSceneIdThe ID of the scene
Returns:
The ID of the data
int OGE_GetSceneGameData ( int  iSceneId)

Get the default data of the scene.

Parameters:
[in]iSceneIdThe ID of the scene
Returns:
The ID of the data
int OGE_GetSceneLightMap ( int  iSceneId)

Get the light map image of the scene.

Parameters:
[in]iSceneIdThe ID of the scene
Returns:
The ID of the image of the light map
string OGE_GetSceneName ( int  iSceneId)

Get the name of the scene.

Parameters:
[in]iSceneIdThe ID of the scene
Returns:
The name of the scene

Get the ID of the plot sprite of current scene.

Returns:
The ID of the plot sprite
int OGE_GetSceneSpr ( int  idx)

Get a sprite in current scene by index.

Parameters:
[in]idxThe index of the sprite in current scene
Returns:
The ID of the sprite
int OGE_GetSceneSprByIndex ( int  iSceneId,
int  iIndex,
int  iState 
)

Get the sprite with special state in the scene by index.

Parameters:
[in]iSceneIdThe ID of the scene
[in]iIndexThe index
[in]iStateThe state
Returns:
The ID of the sprite
int OGE_GetSceneSprCount ( int  iSceneId,
int  iState 
)

Get the count of all the sprites with special state in the scene.

Parameters:
[in]iSceneIdThe ID of the scene
[in]iStateThe state
Returns:
The count of the sprites
string OGE_GetSceneTag ( int  iSceneId)

Get the tag name of the scene.

Parameters:
[in]iSceneIdThe ID of the scene
Returns:
The tag name of the scene

Get the elapsed time of the scene.

Returns:
The elapsed time (in milliseconds)

Get the interval of the timer of current scene.

Returns:
The interval of the timer
int OGE_GetSprForScene ( int  iSceneId,
string  sSprName,
string  sClassName 
)

Create a sprite with specified template, and add it to the scene.

Parameters:
[in]iSceneIdThe ID of the scene
[in]sSprNameThe name of the sprite
[in]sClassNameThe name of the template
Returns:
The ID of the sprite
int OGE_GetTopZ ( )

Get the max value of the z coordinate of the sprites in current scene.

Returns:
The max value of the z coordinate

Check if the timer of current scene is working or not.

Returns:
Returns true if the timer is working
bool OGE_OpenSceneTimer ( int  iInterval)

Open the timer of current scene.

Parameters:
[in]iIntervalThe interval of the timer
Returns:
Returns true if succeed
int OGE_PlayBgMusic ( int  iLoopTimes)

Play the background music.

Parameters:
[in]iLoopTimesThe play times
Returns:
Returns a non-negative number if succeed
void OGE_RemoveScene ( string  sName)

Remove a scene by name.

Parameters:
[in]sNameThe name of the scene
int OGE_RemoveSprFromScene ( int  iSceneId,
int  iSprId 
)

Remove a sprite from the scene.

Parameters:
[in]iSceneIdThe ID of the scene
[in]iSprIdThe ID of the sprite
Returns:
Return a non-negative number if succeed
void OGE_SetDefaultPlayerSpr ( int  iSprId)

Set the default sprite in current scene.

Parameters:
[in]iSprIdThe ID of the sprite
void OGE_SetFirstSpr ( int  iSprId)

Set the first sprite of current scene.

Parameters:
[in]iSprIdThe ID of the first sprite
void OGE_SetFocusSpr ( int  iSprId)

Set the focus sprite of current scene.

Parameters:
[in]iSprIdThe ID of the sprite
void OGE_SetLastSpr ( int  iSprId)

Set the last sprite of current.

Parameters:
[in]iSprIdThe ID of the sprite
void OGE_SetModalSpr ( int  iSprId)

Set the modal sprite of current scene.

Parameters:
[in]iSprIdThe ID of the sprite
void OGE_SetMouseSpr ( int  iSprId)

Set the mouse sprite of current scene.

Parameters:
[in]iSprIdThe ID of the sprite
void OGE_SetProxySpr ( int  iSprId)

Set the proxy sprite of current scene.

Parameters:
[in]iSprIdThe ID of the sprite
int OGE_SetSceneBgMusic ( int  iSceneId,
string  sMusicName 
)

Set background music of current scene.

Parameters:
[in]iSceneIdThe ID of the scene
[in]sMusicNameThe name of the music
Returns:
Returns a non-negative number if succeed
void OGE_SetSceneChapter ( int  iSceneId,
string  sChapterName 
)

Set the chapter name of the scene.

Parameters:
[in]iSceneIdThe ID of the scene
[in]sChapterNameThe name of the chapter
void OGE_SetSceneCustomData ( int  iSceneId,
int  iGameDataId,
bool  bOwnIt 
)

Set the custom data of the scene.

Parameters:
[in]iSceneIdThe ID of the scene
[in]iGameDataIdThe ID of the data
[in]bOwnItLet the scene own the data or not
int OGE_SetSceneFadeIn ( int  iSceneId,
int  iType,
int  iSpeed 
)

Set the fade in action of the scene.

Parameters:
[in]iSceneIdThe ID of the scene
[in]iTypeThe type of fading effect
[in]iSpeedThe speed of fading
Returns:
Return a non-negative number if succeed
int OGE_SetSceneFadeMask ( int  iSceneId,
int  iImageId 
)

Set the mask image for the transaction effect in fade-in fade-out.

Parameters:
[in]iSceneIdThe ID of the scene
[in]iImageIdThe ID of the mask image
Returns:
Return a non-negative number if succeed
int OGE_SetSceneFadeOut ( int  iSceneId,
int  iType,
int  iSpeed 
)

Set the fade out action of the scene.

Parameters:
[in]iSceneIdThe ID of the scene
[in]iTypeThe type of the fading effect
[in]iSpeedThe speed of fading
Returns:
Return a non-negative number if succeed
int OGE_SetSceneLightMap ( int  iSceneId,
int  iImageId,
int  iLightMode 
)

Set the light map of the scene.

Parameters:
[in]iSceneIdThe ID of the scene
[in]iImageIdThe ID of the image of the light map
[in]iLightModeThe light mode
Returns:
The ID of the light map
int OGE_SetSceneMap ( int  iSceneId,
string  sNewMap,
int  iNewLeft,
int  iNewTop 
)

Set the map of the scene.

Parameters:
[in]iSceneIdThe scene ID
[in]sNewMapThe name of the map
[in]iNewLeftThe x coordinate of the viewport position
[in]iNewTopThe y coordinate of the viewport position
Returns:
The ID of the map
void OGE_SetSceneTag ( int  iSceneId,
string  sTagName 
)

Set the tag name of the scene.

Parameters:
[in]iSceneIdThe ID of the scene
[in]sTagNameThe tag name