twn_rendering.c: rename font_path parameter to font
This commit is contained in:
@ -193,7 +193,7 @@ static int b_rectangle(lua_State *L) {
|
||||
* position [table]
|
||||
* height_px [number], optional, defaults to 22
|
||||
* color [table], optional, defaults to black
|
||||
* font_path [string]
|
||||
* font [string]
|
||||
*/
|
||||
static int b_text(lua_State *L) {
|
||||
luaL_checktype(L, 1, LUA_TTABLE);
|
||||
@ -222,12 +222,12 @@ static int b_text(lua_State *L) {
|
||||
if (lua_istable(L, -1))
|
||||
color = table_to_color(L, -1);
|
||||
|
||||
lua_getfield(L, 1, "font_path");
|
||||
const char *font_path = lua_tostring(L, -1);
|
||||
if (font_path == NULL)
|
||||
luaL_error(L, "bad field 'font_path' in 'data' (string expected, got %s)", luaL_typename(L, -1));
|
||||
lua_getfield(L, 1, "font");
|
||||
const char *font = lua_tostring(L, -1);
|
||||
if (font == NULL)
|
||||
luaL_error(L, "bad field 'font' in 'data' (string expected, got %s)", luaL_typename(L, -1));
|
||||
|
||||
push_text(string, (Vec2) { x, y }, height_px, color, font_path);
|
||||
push_text(string, (Vec2) { x, y }, height_px, color, font);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user