summaryrefslogtreecommitdiff
path: root/src/rgui.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rgui.c')
-rw-r--r--src/rgui.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/rgui.c b/src/rgui.c
index fe2806d..2a8e290 100644
--- a/src/rgui.c
+++ b/src/rgui.c
@@ -129,26 +129,16 @@ int lguiGuiGetState( lua_State *L ) {
*/
/*
-> success = RL.GuiSetFont( Font font )
+> RL.GuiSetFont( Font font )
-Set gui custom font ( global state )
-
-- Failure return false
-- Success return true
+Set gui custom font (global state)
*/
int lguiGuiSetFont( lua_State *L ) {
- if ( !lua_isnumber( L, 1 ) ) {
- TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.GuiSetFont( Font font )" );
- lua_pushboolean( L, false );
- return 1;
- }
- size_t fontId = lua_tointeger( L, 1 );
- state->guiFont = fontId;
+ Font *font = luaL_checkudata( L, 1, "Font" );
- GuiSetFont( *state->fonts[ fontId ] );
- lua_pushboolean( L, true );
+ GuiSetFont( *font );
- return 1;
+ return 0;
}
/*
@@ -159,7 +149,7 @@ Get gui custom font ( global state )
- Success return int
*/
int lguiGuiGetFont( lua_State *L ) {
- lua_pushinteger( L, state->guiFont );
+ uluaPushFont( L, GuiGetFont() );
return 1;
}