Open Game Engine 2D API
 All Functions Variables
Functions
Group

Functions

int OGE_FindGroupSpr (int iGroupId, string sSprName)
 Find a sprite in a group by name.
int OGE_GetFreeSprWithType (int iSprGroupId, int iSprType)
 Get a free sprite with special type from the group.
int OGE_GetFreeSprWithClassTag (int iSprGroupId, int iSprClassTag)
 Get a free sprite with special class tag from the group.
int OGE_GetFreeSprWithTag (int iSprGroupId, int iSprTag)
 Get a free sprite with special tag from the group.
int OGE_GetGroupSprCount (int iSprGroupId)
 Get the count of all sprites in the group.
int OGE_GetGroupSprByIndex (int iGroupId, int iIndex)
 Get the sprite in the group by index.
int OGE_GetGroupSpr (int iGroupId, int idx)
 Get the sprite in the group by the code.
int OGE_GetGroupCount ()
 Get the count of all the groups.
int OGE_GetGroupByIndex (int iIndex)
 Get a group by index.
int OGE_GetSprForGroup (int iGroupId, string sSprName, string sClassName)
 Create a sprite with specified template, and add it to the group.
int OGE_RemoveSprFromGroup (int iGroupId, int iSprId)
 Remove a sprite from the group.
void OGE_RemoveGroup (string sName)
 Remove a group by name.
int OGE_GetGroup (string sGroupName)
 Get the group by name.
int OGE_GetGroupByCode (int iCode)
 Get the group by code.
string OGE_GetGroupName (int iSprGroupId)
 Get the name of the group.
void OGE_OpenGroup (int iSprGroupId)
 Add all the sprites of the group into current scene.
void OGE_CloseGroup (int iSprGroupId)
 Remove all the sprites of the group from current scene.
int OGE_GroupGenSpr (int iSprGroupId, string sTempletSprName, int iCount)
 Generate sprites in the group by a sprite template.
int OGE_GetRootSprFromGroup (int iSprGroupId)
 Get the first sprite of the group.
int OGE_GetFreeSprFromGroup (int iSprGroupId)
 Get a free (not busy) sprite from the group.

Function Documentation

void OGE_CloseGroup ( int  iSprGroupId)

Remove all the sprites of the group from current scene.

Parameters:
[in]iSprGroupIdThe ID of the group
int OGE_FindGroupSpr ( int  iGroupId,
string  sSprName 
)

Find a sprite in a group by name.

Parameters:
[in]iGroupIdThe ID of the group
[in]sSprNameThe name of the sprite
Returns:
The ID of the sprite
int OGE_GetFreeSprFromGroup ( int  iSprGroupId)

Get a free (not busy) sprite from the group.

Parameters:
[in]iSprGroupIdThe ID of the group
Returns:
The ID of the free sprite
int OGE_GetFreeSprWithClassTag ( int  iSprGroupId,
int  iSprClassTag 
)

Get a free sprite with special class tag from the group.

Parameters:
[in]iSprGroupIdThe ID of the group
[in]iSprClassTagThe class tag
Returns:
The ID of the sprite
int OGE_GetFreeSprWithTag ( int  iSprGroupId,
int  iSprTag 
)

Get a free sprite with special tag from the group.

Parameters:
[in]iSprGroupIdThe ID of the group
[in]iSprTagThe tag (object tag)
Returns:
The ID of the free sprite
int OGE_GetFreeSprWithType ( int  iSprGroupId,
int  iSprType 
)

Get a free sprite with special type from the group.

Parameters:
[in]iSprGroupIdThe ID of the group
[in]iSprTypeThe type of the sprite
Returns:
The ID of the sprite
int OGE_GetGroup ( string  sGroupName)

Get the group by name.

Parameters:
[in]sGroupNameThe name of the group
Returns:
The ID of the group
int OGE_GetGroupByCode ( int  iCode)

Get the group by code.

Parameters:
[in]iCodeThe code of the group
Returns:
The ID of the group
int OGE_GetGroupByIndex ( int  iIndex)

Get a group by index.

Parameters:
[in]iIndexThe index of the group
Returns:
The ID of the group

Get the count of all the groups.

Returns:
The count of all the groups
string OGE_GetGroupName ( int  iSprGroupId)

Get the name of the group.

Parameters:
[in]iSprGroupIdThe ID of the group
Returns:
The name of the group
int OGE_GetGroupSpr ( int  iGroupId,
int  idx 
)

Get the sprite in the group by the code.

Parameters:
[in]iGroupIdThe ID of the group
[in]idxThe code
Returns:
The ID of the sprite
int OGE_GetGroupSprByIndex ( int  iGroupId,
int  iIndex 
)

Get the sprite in the group by index.

Parameters:
[in]iGroupIdThe ID of the group
[in]iIndexThe index of the sprite
Returns:
The ID of the sprite
int OGE_GetGroupSprCount ( int  iSprGroupId)

Get the count of all sprites in the group.

Parameters:
[in]iSprGroupIdThe ID of the group
Returns:
The count of all the sprites
int OGE_GetRootSprFromGroup ( int  iSprGroupId)

Get the first sprite of the group.

Parameters:
[in]iSprGroupIdThe ID of the group
Returns:
The ID of the first sprite
int OGE_GetSprForGroup ( int  iGroupId,
string  sSprName,
string  sClassName 
)

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

Parameters:
[in]iGroupIdThe ID of the group
[in]sSprNameThe name of the sprite
[in]sClassNameThe name of the template
Returns:
The ID of the sprite
int OGE_GroupGenSpr ( int  iSprGroupId,
string  sTempletSprName,
int  iCount 
)

Generate sprites in the group by a sprite template.

Parameters:
[in]iSprGroupIdThe ID of the group
[in]sTempletSprNameThe name of the template sprite
[in]iCountThe count of the sprites will be generated
Returns:
The count of all the sprites in the group
void OGE_OpenGroup ( int  iSprGroupId)

Add all the sprites of the group into current scene.

Parameters:
[in]iSprGroupIdThe ID of the group
void OGE_RemoveGroup ( string  sName)

Remove a group by name.

Parameters:
[in]sNameThe name of the group
int OGE_RemoveSprFromGroup ( int  iGroupId,
int  iSprId 
)

Remove a sprite from the group.

Parameters:
[in]iGroupIdThe ID of the group
[in]iSprIdThe ID of the sprite
Returns:
Return a non-negative number if succeed