MCPcopy Create free account
hub / github.com/clementgallet/libTAS / text

Method text

src/program/lua/Gui.cpp:71–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71int 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
95int Lua::Gui::window(lua_State *L)
96{

Callers 15

slotMoviePathChangedMethod · 0.80
dataMethod · 0.80
pasteInputsMethod · 0.80
pasteInputsInRangeMethod · 0.80
pasteInsertInputsMethod · 0.80
getCompareParametersMethod · 0.80
threadedNewMethod · 0.80
slotPokeMethod · 0.80
slotSaveMethod · 0.80
slotOkMethod · 0.80
slotDefaultMethod · 0.80

Calls 3

sendMessageFunction · 0.85
sendDataFunction · 0.85
sendStringFunction · 0.85

Tested by

no test coverage detected