Rest of the core misc functions.

This commit is contained in:
jussi
2022-06-11 22:13:59 +03:00
parent 403e59a0b0
commit 9dd3fa10ce
5 changed files with 93 additions and 1 deletions

View File

@@ -617,6 +617,46 @@ int lcoreGetTime( lua_State *L ) {
## Core - Misc
*/
/*
> success = RL_TakeScreenshot( string fileName )
Takes a screenshot of current screen ( filename extension defines format )
- Failure return false
- Success return true
*/
int lcoreTakeScreenshot( lua_State *L ) {
if ( !lua_isstring( L, -1 ) ) {
TraceLog( LOG_WARNING, "%s", "Bad call of function. RL_TakeScreenshot( string fileName )" );
lua_pushboolean( L, false );
return 1;
}
TakeScreenshot( lua_tostring( L, -1 ) );
lua_pushboolean( L, true );
return 1;
}
/*
> success = RL_SetConfigFlags( int flags )
Setup init configuration flags ( view FLAGS )
- Failure return false
- Success return true
*/
int lcoreSetConfigFlags( lua_State *L ) {
if ( !lua_isnumber( L, -1 ) ) {
TraceLog( LOG_WARNING, "%s", "Bad call of function. RL_SetConfigFlags( int flags )" );
lua_pushboolean( L, false );
return 1;
}
SetConfigFlags( lua_tointeger( L, -1 ) );
lua_pushboolean( L, true );
return 1;
}
/*
> success = RL_TraceLog( int logLevel, string text )
@@ -637,6 +677,26 @@ int lcoreTraceLog( lua_State *L ) {
return 1;
}
/*
> success = RL_SetTraceLogLevel( int logLevel )
Set the current threshold ( minimum ) log level
- Failure return false
- Success return true
*/
int lcoreSetTraceLogLevel( lua_State *L ) {
if ( !lua_isnumber( L, -1 ) ) {
TraceLog( LOG_WARNING, "%s", "Bad call of function. RL_SetTraceLogLevel( int logLevel )" );
lua_pushboolean( L, false );
return 1;
}
SetTraceLogLevel( lua_tointeger( L, -1 ) );
lua_pushboolean( L, true );
return 1;
}
/*
> success = RL_OpenURL( string url )