twn_rendering.c: rename font_path parameter to font
This commit is contained in:
parent
b9f2de1e28
commit
cfdc1f5f28
@ -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;
|
||||
}
|
||||
|
||||
|
@ -33,8 +33,8 @@ TWN_API void push_rectangle(Rect rect, Color color);
|
||||
/* pushes a filled circle onto the circle render queue */
|
||||
TWN_API void push_circle(Vec2 position, float radius, Color color);
|
||||
|
||||
TWN_API void push_text(char *string, Vec2 position, int height_px, Color color, const char *font_path);
|
||||
TWN_API int text_get_width(char *string, int height_px, const char *font_path);
|
||||
TWN_API void push_text(char *string, Vec2 position, int height_px, Color color, const char *font);
|
||||
TWN_API int text_get_width(char *string, int height_px, const char *font);
|
||||
|
||||
TWN_API void push_9slice(char *texture_path, int texture_w, int texture_h, int border_thickness, Rect rect, Color color);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user