diff options
| author | jussi | 2023-10-29 15:21:10 +0200 |
|---|---|---|
| committer | jussi | 2023-10-29 15:21:10 +0200 |
| commit | 0df40e2ac080364bcebd4fe0445b814230545477 (patch) | |
| tree | 36be0ab558d6642352c0bb3034b6e6b32471716d /src/textures.c | |
| parent | 76911d45a879838047b2845cd6124e9ca3af083a (diff) | |
| download | reilua-enhanced-0df40e2ac080364bcebd4fe0445b814230545477.tar.gz reilua-enhanced-0df40e2ac080364bcebd4fe0445b814230545477.tar.bz2 reilua-enhanced-0df40e2ac080364bcebd4fe0445b814230545477.zip | |
Shapes, RLGL, Math, Gui and Easings to new style.
Diffstat (limited to 'src/textures.c')
| -rw-r--r-- | src/textures.c | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/src/textures.c b/src/textures.c index 2ebf9cb..aa78ce8 100644 --- a/src/textures.c +++ b/src/textures.c @@ -276,30 +276,17 @@ int ltexturesImageFromImage( lua_State *L ) { Create an image from text (custom sprite font) -- Failure return -1 -- Success return int +- Success return Image */ int ltexturesImageText( lua_State *L ) { - // if ( !lua_isnumber( L, 1 ) || !lua_isstring( L, 2 ) || !lua_isnumber( L, 3 ) - // || !lua_isnumber( L, 4 ) || !lua_istable( L, 5 ) ) { - // TraceLog( state->logLevelInvalid, "%s", "Bad call of function. RL.ImageText( Font font, string text, float fontSize, float spacing, Color tint )" ); - // lua_pushinteger( L, -1 ); - // return 1; - // } - // size_t fontId = lua_tointeger( L, 1 ); - // float fontSize = lua_tonumber( L, 3 ); - // float spacing = lua_tonumber( L, 4 ); - // Color tint = uluaGetColorIndex( L, 5 ); - - // if ( !validFont( fontId ) ) { - // lua_pushinteger( L, -1 ); - // return 1; - // } - // int i = newImage(); - // *state->images[i] = ImageTextEx( *state->fonts[ fontId ], lua_tostring( L, 2 ), fontSize, spacing, tint ); - // lua_pushinteger( L, i ); + Font *font = luaL_checkudata( L, 1, "Font" ); + float fontSize = lua_tonumber( L, 3 ); + float spacing = lua_tonumber( L, 4 ); + Color tint = uluaGetColorIndex( L, 5 ); - return 0; + uluaPushImage( L, ImageTextEx( *font, luaL_checkstring( L, 2 ), fontSize, spacing, tint ) ); + + return 1; } /* |
