Open Game Engine 2D API
|
Functions | |
int | OGE_GetMap () |
Get the map of current scene. | |
int | OGE_GetMapByName (string sMapName) |
Get the map by name. | |
string | OGE_GetMapName (int iMapId) |
Get the name of the map. | |
int | OGE_GetMapWidth (int iMapId) |
Get the width of the map. | |
int | OGE_GetMapHeight (int iMapId) |
Get the height of the map. | |
int | OGE_GetMapImage (int iMapId) |
Get the image ID of the map. | |
bool | OGE_GetEightDirectionMode (int iMapId) |
Check if the map is in eight-direction mode or not. | |
void | OGE_SetEightDirectionMode (int iMapId, bool value) |
Let the map use eight-direction mode or four-direction mode. | |
int | OGE_GetColumnCount (int iMapId) |
Get column count of the tiles of the map. | |
int | OGE_GetRowCount (int iMapId) |
Get the row count of tiles of the map. | |
int | OGE_GetTileValue (int iMapId, int iTileX, int iTileY) |
Get the value of the tile. | |
int | OGE_SetTileValue (int iMapId, int iTileX, int iTileY, int iValue) |
Set the value of one tile of the map. | |
void | OGE_ReloadTileValues (int iMapId) |
Reload all the values of the tiles form the config file. | |
void | OGE_ResetGameMap (int iMapId) |
Reload all values of the tiles from the config file and reset all tile data to be zero. | |
int | OGE_GetTileData (int iMapId, int iTileX, int iTileY) |
Get the data value of a tile of a map. | |
int | OGE_SetTileData (int iMapId, int iTileX, int iTileY, int iValue) |
Set the value of the data related to a tile of a map. | |
void | OGE_InitTileData (int iMapId, int iInitValue) |
Reset all data of all tiles to be a same value. | |
void | OGE_InitTileValues (int iMapId, int iInitValue) |
Reset the values of all the tiles to be a same number. | |
bool | OGE_PixelToTile (int iMapId, int iPixelX, int iPixelY, int &iTileX, int &iTileY) |
Input the position of the pixel and output the position of the tile (column and row) | |
bool | OGE_TileToPixel (int iMapId, int iTileX, int iTileY, int &iPixelX, int &iPixelY) |
Input the position of the tile (column and row) and output the position of the pixel. | |
bool | OGE_AlignPixel (int iMapId, int iInPixelX, int iInPixelY, int &iOutPixelX, int &iOutPixelY) |
Align pixel to tile. | |
int | OGE_FindWay (int iMapId, int iStartX, int iStartY, int iEndX, int iEndY, int iTileListId) |
Find the way out for walking from one tile to another. | |
int | OGE_FindRange (int iMapId, int iPosX, int iPosY, int iMovementPoints, int iTileListId) |
Find the movement range in a tile map. | |
int | OGE_GetTileListSize (int iTileListId) |
Get the size of the tile list. | |
int | OGE_GetTileXFromList (int iTileListId, int iIndex) |
Get the column number of the tile in the list. | |
int | OGE_GetTileYFromList (int iTileListId, int iIndex) |
Get row number of a tile in a list. | |
int | OGE_GetTileIndexInList (int iTileListId, int iTileX, int iTileY) |
Get the index of a tile in a list. | |
int | OGE_AddTileToList (int iTileListId, int iTileX, int iTileY) |
Add a tile to a list. | |
int | OGE_RemoveTileFromList (int iTileListId, int iIndex) |
Remove a tile from a list. | |
void | OGE_ClearTileList (int iTileListId) |
Clear the tile list. | |
void | OGE_RemoveGameMap (string sName) |
Remove a map by name. |
int OGE_AddTileToList | ( | int | iTileListId, |
int | iTileX, | ||
int | iTileY | ||
) |
Add a tile to a list.
[in] | iTileListId | The ID of the tile list |
[in] | iTileX | The column number of the tile |
[in] | iTileY | The row number of the tile |
bool OGE_AlignPixel | ( | int | iMapId, |
int | iInPixelX, | ||
int | iInPixelY, | ||
int & | iOutPixelX, | ||
int & | iOutPixelY | ||
) |
Align pixel to tile.
[in] | iMapId | The ID of the map |
[in] | iInPixelX | The x coordinate of the pixel position |
[in] | iInPixelY | The y coordinate of the pixel position |
[out] | iOutPixelX | The x coordinate of the pixel aligned |
[out] | iOutPixelY | the y coordinate of the pixel aligned |
void OGE_ClearTileList | ( | int | iTileListId | ) |
Clear the tile list.
[in] | iTileListId | The ID of the tile list |
int OGE_FindRange | ( | int | iMapId, |
int | iPosX, | ||
int | iPosY, | ||
int | iMovementPoints, | ||
int | iTileListId | ||
) |
Find the movement range in a tile map.
[in] | iMapId | The ID of the map |
[in] | iPosX | The column number of current tile |
[in] | iPosY | The row number of current tile |
[in] | iMovementPoints | The points of the movement |
[in] | iTileListId | The list of the tiles in the range |
int OGE_FindWay | ( | int | iMapId, |
int | iStartX, | ||
int | iStartY, | ||
int | iEndX, | ||
int | iEndY, | ||
int | iTileListId | ||
) |
Find the way out for walking from one tile to another.
[in] | iMapId | The ID of the map |
[in] | iStartX | The column number of the start position |
[in] | iStartY | The row number of the start position |
[in] | iEndX | The column number of the end position |
[in] | iEndY | The row number of the end position |
[in] | iTileListId | The list of the tiles which are used to store the way |
int OGE_GetColumnCount | ( | int | iMapId | ) |
Get column count of the tiles of the map.
[in] | iMapId | The ID of the map |
bool OGE_GetEightDirectionMode | ( | int | iMapId | ) |
Check if the map is in eight-direction mode or not.
[in] | iMapId | The ID of the map |
int OGE_GetMap | ( | ) |
Get the map of current scene.
int OGE_GetMapByName | ( | string | sMapName | ) |
Get the map by name.
[in] | sMapName | The name of the map |
int OGE_GetMapHeight | ( | int | iMapId | ) |
Get the height of the map.
[in] | iMapId | The ID of the map |
int OGE_GetMapImage | ( | int | iMapId | ) |
Get the image ID of the map.
[in] | iMapId | The ID of the map |
string OGE_GetMapName | ( | int | iMapId | ) |
Get the name of the map.
[in] | iMapId | The ID of the map |
int OGE_GetMapWidth | ( | int | iMapId | ) |
Get the width of the map.
[in] | iMapId | The ID of the map |
int OGE_GetRowCount | ( | int | iMapId | ) |
Get the row count of tiles of the map.
[in] | iMapId | The ID of the map |
int OGE_GetTileData | ( | int | iMapId, |
int | iTileX, | ||
int | iTileY | ||
) |
Get the data value of a tile of a map.
[in] | iMapId | The ID of the map |
[in] | iTileX | The column number of the tile |
[in] | iTileY | The row number of the tile |
int OGE_GetTileIndexInList | ( | int | iTileListId, |
int | iTileX, | ||
int | iTileY | ||
) |
Get the index of a tile in a list.
[in] | iTileListId | The ID of the tile list |
[in] | iTileX | The column number of the tile |
[in] | iTileY | The row number of the tile |
int OGE_GetTileListSize | ( | int | iTileListId | ) |
Get the size of the tile list.
[in] | iTileListId | The ID of the tile list |
int OGE_GetTileValue | ( | int | iMapId, |
int | iTileX, | ||
int | iTileY | ||
) |
Get the value of the tile.
[in] | iMapId | The ID of the map |
[in] | iTileX | The column number of the tile |
[in] | iTileY | The row number of the tile |
int OGE_GetTileXFromList | ( | int | iTileListId, |
int | iIndex | ||
) |
Get the column number of the tile in the list.
[in] | iTileListId | The ID of the tile list |
[in] | iIndex | The index of the tile in the list |
int OGE_GetTileYFromList | ( | int | iTileListId, |
int | iIndex | ||
) |
Get row number of a tile in a list.
[in] | iTileListId | The ID of the tile list |
[in] | iIndex | The index of the tile in the list |
void OGE_InitTileData | ( | int | iMapId, |
int | iInitValue | ||
) |
Reset all data of all tiles to be a same value.
[in] | iMapId | The ID of the map |
[in] | iInitValue | The value of all the data |
void OGE_InitTileValues | ( | int | iMapId, |
int | iInitValue | ||
) |
Reset the values of all the tiles to be a same number.
[in] | iMapId | The ID of the map |
[in] | iInitValue | The value for all the tiles |
bool OGE_PixelToTile | ( | int | iMapId, |
int | iPixelX, | ||
int | iPixelY, | ||
int & | iTileX, | ||
int & | iTileY | ||
) |
Input the position of the pixel and output the position of the tile (column and row)
[in] | iMapId | The ID of the map |
[in] | iPixelX | The x coordinate of the pixel position |
[in] | iPixelY | The y coordinate of the pixel position |
[out] | iTileX | The column number of the tile |
[out] | iTileY | The row number of the tile |
void OGE_ReloadTileValues | ( | int | iMapId | ) |
Reload all the values of the tiles form the config file.
[in] | iMapId | The ID of the map |
void OGE_RemoveGameMap | ( | string | sName | ) |
Remove a map by name.
[in] | sName | The name of the map |
int OGE_RemoveTileFromList | ( | int | iTileListId, |
int | iIndex | ||
) |
Remove a tile from a list.
[in] | iTileListId | The ID of the tile list |
[in] | iIndex | The index of the tile |
void OGE_ResetGameMap | ( | int | iMapId | ) |
Reload all values of the tiles from the config file and reset all tile data to be zero.
[in] | iMapId | The ID of the map |
void OGE_SetEightDirectionMode | ( | int | iMapId, |
bool | value | ||
) |
Let the map use eight-direction mode or four-direction mode.
[in] | iMapId | The ID of the map |
[in] | value | If true then the map will use eight-direction mode |
int OGE_SetTileData | ( | int | iMapId, |
int | iTileX, | ||
int | iTileY, | ||
int | iValue | ||
) |
Set the value of the data related to a tile of a map.
[in] | iMapId | The ID of the map |
[in] | iTileX | The column number of the tile |
[in] | iTileY | The row number of the tile |
[in] | iValue | The value of the data related to the tile |
int OGE_SetTileValue | ( | int | iMapId, |
int | iTileX, | ||
int | iTileY, | ||
int | iValue | ||
) |
Set the value of one tile of the map.
[in] | iMapId | The ID of the map |
[in] | iTileX | The column number of the tile |
[in] | iTileY | The row number of the tile |
[in] | iValue | The value of the tile |
bool OGE_TileToPixel | ( | int | iMapId, |
int | iTileX, | ||
int | iTileY, | ||
int & | iPixelX, | ||
int & | iPixelY | ||
) |
Input the position of the tile (column and row) and output the position of the pixel.
[in] | iMapId | The ID of the map |
[in] | iTileX | The column number of the tile |
[in] | iTileY | The row number of the tile |
[out] | iPixelX | The x coordinate of the pixel position |
[out] | iPixelY | The y coordinate of the pixel position |