| 69 | } |
| 70 | |
| 71 | int Lua::Gui::text(lua_State *L) |
| 72 | { |
| 73 | float x = lua_tonumber(L, 1); |
| 74 | float y = lua_tonumber(L, 2); |
| 75 | std::string text = luaL_checklstring(L, 3, nullptr); |
| 76 | uint32_t color = luaL_optnumber (L, 4, 0xffffffff); |
| 77 | float anchor_x = luaL_optnumber(L, 5, 0.0f); |
| 78 | float anchor_y = luaL_optnumber(L, 6, 0.0f); |
| 79 | float font_size = static_cast<float>(luaL_optnumber(L, 7, 16.0f)); |
| 80 | bool monospace = static_cast<bool>(luaL_optinteger(L, 8, 0)); |
| 81 | |
| 82 | sendMessage(MSGN_LUA_TEXT); |
| 83 | sendData(&x, sizeof(float)); |
| 84 | sendData(&y, sizeof(float)); |
| 85 | sendString(text); |
| 86 | sendData(&color, sizeof(uint32_t)); |
| 87 | sendData(&anchor_x, sizeof(float)); |
| 88 | sendData(&anchor_y, sizeof(float)); |
| 89 | sendData(&font_size, sizeof(float)); |
| 90 | sendData(&monospace, sizeof(bool)); |
| 91 | |
| 92 | return 0; |
| 93 | } |
| 94 | |
| 95 | int Lua::Gui::window(lua_State *L) |
| 96 | { |
no test coverage detected