Open Game Engine 2D API
 All Functions Variables
Functions
Common

Functions

void OGE_Print (string sInfo)
 Output text to console.
string OGE_IntToStr (int iValue)
 Convert integer to string.
int OGE_StrToInt (string sValue)
 Convert string to integer.
int OGE_HexToInt (string sValue)
 Convert hexadecimal string to integer.
string OGE_FloatToStr (double fValue)
 Convert a floating-point value to a string.
double OGE_StrToFloat (string sValue)
 Convert a string value to a floating-point value.
string OGE_TrimStr (string sText)
 Trim the string value.
int OGE_GetTicks ()
 Retrieves the number of milliseconds that have elapsed since the system was started.
int OGE_GetOS ()
 Get the type of current OS.
string OGE_GetDateTimeStr ()
 Get the string format of current date time.
bool OGE_GetDateTime (int &year, int &month, int &day, int &hour, int &min, int &sec)
 Get current date time.
void OGE_Delay (int iMilliSeconds)
 Waits a specified number of milliseconds before returning.
int OGE_Random (int iMax)
 Get an integer random value in some range (greater than or equal to zero)
double OGE_RandomFloat ()
 Get a float-pointing random value between 0 and 1.
int OGE_MakeColor (int iRed, int iGreen, int iBlue)
 Map a RGB color value to a pixel format.
string OGE_GetDefaultCharset ()
 Get the default charset of the game.
void OGE_SetDefaultCharset (string sCharsetName)
 Set the default charset.
string OGE_GetSystemCharset ()
 Get the charset of the OS.
void OGE_SetSystemCharset (string sCharsetName)
 Tell the game engine the name of the charset used by the OS.
bool OGE_IsInputUnicode ()
 Check if current input text is unicode or not.
int OGE_StrToUnicode (string sText, string sCharsetName, int iBufferId)
 Convert string to unicode.
string OGE_UnicodeToStr (int iUnicodeBufferId, int iBufferSize, string sCharsetName)
 Convert unicode to string.
int OGE_StrLen (string sText)
 Get the length of the string.
int OGE_FindStr (string sText, string sSubText, int iStartPos)
 Find the position of a sub string in some string.
string OGE_CopyStr (string sText, int iStartPos, int iCount)
 Copy a sub string from some string.
string OGE_DeleteStr (string sText, int iStartPos, int iCount)
 Delete a sub string from some string.
string OGE_ReplaceStr (string sText, string sOldSubText, string sNewSubText)
 Replace all occurrences of substring with another one.

Function Documentation

string OGE_CopyStr ( string  sText,
int  iStartPos,
int  iCount 
)

Copy a sub string from some string.

Parameters:
[in]sTextThe string
[in]iStartPosThe starting position
[in]iCountThe length of the sub string
Returns:
The sub string
void OGE_Delay ( int  iMilliSeconds)

Waits a specified number of milliseconds before returning.

Parameters:
[in]iMilliSecondsThe number of milliseconds
string OGE_DeleteStr ( string  sText,
int  iStartPos,
int  iCount 
)

Delete a sub string from some string.

Parameters:
[in]sTextThe string
[in]iStartPosThe starting position
[in]iCountThe number of the characters will be deleted
Returns:
The string after removing the characters
int OGE_FindStr ( string  sText,
string  sSubText,
int  iStartPos 
)

Find the position of a sub string in some string.

Parameters:
[in]sTextThe string
[in]sSubTextThe sub string
[in]iStartPosSpecify the position to begin searching
Returns:
The position of the sub string
string OGE_FloatToStr ( double  fValue)

Convert a floating-point value to a string.

Parameters:
[in]fValueThe floating-point value
Returns:
The string value
bool OGE_GetDateTime ( int &  year,
int &  month,
int &  day,
int &  hour,
int &  min,
int &  sec 
)

Get current date time.

Parameters:
[out]yearThe year of current date time
[out]monthThe month of current date time
[out]dayThe day of current date time
[out]hourThe hour of current date time
[out]minThe minute of current date time
[out]secThe second of current date time
Returns:
Returns true if succeed
string OGE_GetDateTimeStr ( )

Get the string format of current date time.

Returns:
The string format of current date time

Get the default charset of the game.

Returns:
The name of the default charset
int OGE_GetOS ( )

Get the type of current OS.

Returns:
The type of current OS

Get the charset of the OS.

Returns:
The name of the charset
int OGE_GetTicks ( )

Retrieves the number of milliseconds that have elapsed since the system was started.

Returns:
The number of milliseconds
int OGE_HexToInt ( string  sValue)

Convert hexadecimal string to integer.

Parameters:
[in]sValueThe hexadecimal string
Returns:
The integer
string OGE_IntToStr ( int  iValue)

Convert integer to string.

Parameters:
[in]iValueThe integer value
Returns:
The string value

Check if current input text is unicode or not.

Returns:
Returns true if it is unicode
int OGE_MakeColor ( int  iRed,
int  iGreen,
int  iBlue 
)

Map a RGB color value to a pixel format.

Parameters:
[in]iRedThe red value
[in]iGreenThe green value
[in]iBlueThe blue value
Returns:
A pixel value matched current color format
void OGE_Print ( string  sInfo)

Output text to console.

Parameters:
[in]sInfoThe output text
int OGE_Random ( int  iMax)

Get an integer random value in some range (greater than or equal to zero)

Parameters:
[in]iMaxThe max value of the random number
Returns:
A random number between 0 and the max value
double OGE_RandomFloat ( )

Get a float-pointing random value between 0 and 1.

Returns:
The random float-pointing value
string OGE_ReplaceStr ( string  sText,
string  sOldSubText,
string  sNewSubText 
)

Replace all occurrences of substring with another one.

Parameters:
[in]sTextThe string
[in]sOldSubTextThe substring to search for replacing
[in]sNewSubTextThe substitution substring
Returns:
The new string after replacing substrings
void OGE_SetDefaultCharset ( string  sCharsetName)

Set the default charset.

Parameters:
[in]sCharsetNameThe name of the default charset
void OGE_SetSystemCharset ( string  sCharsetName)

Tell the game engine the name of the charset used by the OS.

Parameters:
[in]sCharsetNameThe name of the charset
int OGE_StrLen ( string  sText)

Get the length of the string.

Parameters:
[in]sTextThe string
Returns:
The length of the string
double OGE_StrToFloat ( string  sValue)

Convert a string value to a floating-point value.

Parameters:
[in]sValueThe string value
Returns:
The floating-point value
int OGE_StrToInt ( string  sValue)

Convert string to integer.

Parameters:
[in]sValueThe string value
Returns:
The integer value
int OGE_StrToUnicode ( string  sText,
string  sCharsetName,
int  iBufferId 
)

Convert string to unicode.

Parameters:
[in]sTextThe string
[in]sCharsetNameCharset of the string
[in]iBufferIdThe ID of the buffer where the unicode output will be stored
Returns:
Returns the length of the unicode string if it succeeds
string OGE_TrimStr ( string  sText)

Trim the string value.

Parameters:
[in]sTextThe input string
Returns:
The output string after trimming
string OGE_UnicodeToStr ( int  iUnicodeBufferId,
int  iBufferSize,
string  sCharsetName 
)

Convert unicode to string.

Parameters:
[in]iUnicodeBufferIdThe ID of the buffer where the unicode string lies
[in]iBufferSizeThe size of the buffer
[in]sCharsetNameThe charset of the output string
Returns:
The output string