From 30c7a5eda27ef0e424bf7948e3cd37a1cf5a52ef Mon Sep 17 00:00:00 2001 From: jussi Date: Wed, 2 Oct 2024 13:02:13 +0300 Subject: GuiSetSliderDragging, GuiGetSliderDragging, GuiSetSliderActive and GuiGetSliderActive. --- src/lua_core.c | 4 ++++ src/rgui.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/lua_core.c b/src/lua_core.c index 508158d..94c2134 100644 --- a/src/lua_core.c +++ b/src/lua_core.c @@ -2075,6 +2075,10 @@ void luaRegister() { assingGlobalFunction( "GuiSetAlpha", lguiGuiSetAlpha ); assingGlobalFunction( "GuiSetState", lguiGuiSetState ); assingGlobalFunction( "GuiGetState", lguiGuiGetState ); + assingGlobalFunction( "GuiSetSliderDragging", lguiGuiSetSliderDragging ); + assingGlobalFunction( "GuiGetSliderDragging", lguiGuiGetSliderDragging ); + assingGlobalFunction( "GuiSetSliderActive", lguiGuiSetSliderActive ); + assingGlobalFunction( "GuiGetSliderActive", lguiGuiGetSliderActive ); /* Font set/get functions. */ assingGlobalFunction( "GuiSetFont", lguiGuiSetFont ); assingGlobalFunction( "GuiGetFont", lguiGuiGetFont ); diff --git a/src/rgui.c b/src/rgui.c index 106180e..f1532a3 100644 --- a/src/rgui.c +++ b/src/rgui.c @@ -116,6 +116,58 @@ int lguiGuiGetState( lua_State* L ) { return 1; } +/* +> RL.GuiSetSliderDragging() + +Set guiSliderDragging +*/ +int lguiGuiSetSliderDragging( lua_State* L ) { + bool dragging = lua_toboolean( L, 1 ); + + GuiSetSliderDragging( dragging ); + + return 0; +} + +/* +> isSliderDragging = RL.GuiGetSliderDragging() + +Get guiSliderDragging + +- Success return bool +*/ +int lguiGuiGetSliderDragging( lua_State* L ) { + lua_pushboolean( L, GuiGetSliderDragging() ); + + return 1; +} + +/* +> RL.GuiSetSliderActive() + +Set guiSliderActive +*/ +int lguiGuiSetSliderActive( lua_State* L ) { + Rectangle rect = uluaGetRectangle( L, 1 ); + + GuiSetSliderActive( rect ); + + return 0; +} + +/* +> isSliderDragging = RL.GuiGetSliderActive() + +Get guiSliderActive + +- Success return Rectangle +*/ +int lguiGuiGetSliderActive( lua_State* L ) { + uluaPushRectangle( L, GuiGetSliderActive() ); + + return 1; +} + /* ## Gui - Font set/get functions */ @@ -203,7 +255,6 @@ int lguiGuiLoadStyle( lua_State* L ) { return 1; } - // state->guiFont = GuiGetFont(); TraceLog( state->logLevelInvalid, "Invalid file '%s'", lua_tostring( L, 1 ) ); lua_pushnil( L ); -- cgit v1.2.3