6 struct render_object_text
: public render_object
8 render_object_text(int32_t _x
, int32_t _y
, const std::string
& _text
, premultiplied_color _fg
,
9 premultiplied_color _bg
) throw()
10 : x(_x
), y(_y
), text(_text
), fg(_fg
), bg(_bg
) {}
11 ~render_object_text() throw() {}
12 void operator()(struct screen
& scr
) throw()
14 render_text(scr
, x
, y
, text
, fg
, bg
);
19 premultiplied_color fg
;
20 premultiplied_color bg
;
24 function_ptr_luafun
gui_text("gui.text", [](lua_State
* LS
, const std::string
& fname
) -> int {
27 int64_t fgc
= 0xFFFFFFU
;
29 int32_t _x
= get_numeric_argument
<int32_t>(LS
, 1, fname
.c_str());
30 int32_t _y
= get_numeric_argument
<int32_t>(LS
, 2, fname
.c_str());
31 get_numeric_argument
<int64_t>(LS
, 4, fgc
, fname
.c_str());
32 get_numeric_argument
<int64_t>(LS
, 5, bgc
, fname
.c_str());
33 std::string text
= get_string_argument(LS
, 3, fname
.c_str());
34 premultiplied_color
fg(fgc
);
35 premultiplied_color
bg(bgc
);
36 lua_render_ctx
->queue
->add(*new render_object_text(_x
, _y
, text
, fg
, bg
));