mirror of
https://github.com/diasurgical/DevilutionX.git
synced 2026-06-20 05:44:36 +00:00
de6eac137b
```lua
local render = devilutionx.render
local function drawGreet ()
render.string("Hello from " .. _VERSION, 10, 40)
end
Events.OnGameDrawComplete.Add(drawGreet)
```
17 lines
384 B
C++
17 lines
384 B
C++
#include "lua/modules/render.hpp"
|
|
|
|
#include <sol/sol.hpp>
|
|
|
|
#include "engine/dx.h"
|
|
#include "engine/render/text_render.hpp"
|
|
|
|
namespace devilution {
|
|
|
|
sol::table LuaRenderModule(sol::state_view &lua)
|
|
{
|
|
return lua.create_table_with(
|
|
"string", [](std::string_view text, int x, int y) { DrawString(GlobalBackBuffer(), text, { x, y }); });
|
|
}
|
|
|
|
} // namespace devilution
|