6 struct render_object_text
: public render_object
8 render_object_text(int32_t _x
, int32_t _y
, const std::string
& _text
, uint16_t _fg
= 0x7FFFU
,
9 uint8_t _fgalpha
= 32, uint16_t _bg
= 0, uint8_t _bgalpha
= 0) throw(std::bad_alloc
);
10 ~render_object_text() throw();
11 void operator()(struct screen
& scr
) throw();
22 render_object_text::render_object_text(int32_t _x
, int32_t _y
, const std::string
& _text
, uint16_t _fg
,
23 uint8_t _fgalpha
, uint16_t _bg
, uint8_t _bgalpha
) throw(std::bad_alloc
)
24 : x(_x
), y(_y
), fg(_fg
), fgalpha(_fgalpha
), bg(_bg
), bgalpha(_bgalpha
), text(_text
)
28 void render_object_text::operator()(struct screen
& scr
) throw()
30 render_text(scr
, x
, y
, text
, fg
, fgalpha
, bg
, bgalpha
);
33 render_object_text::~render_object_text() throw()
37 function_ptr_luafun
gui_text("gui.text", [](lua_State
* LS
, const std::string
& fname
) -> int {
40 uint32_t fgc
= 0x7FFFU
;
44 int32_t _x
= get_numeric_argument
<int32_t>(LS
, 1, fname
.c_str());
45 int32_t _y
= get_numeric_argument
<int32_t>(LS
, 2, fname
.c_str());
46 get_numeric_argument
<uint32_t>(LS
, 4, fgc
, fname
.c_str());
47 get_numeric_argument
<uint16_t>(LS
, 5, fga
, fname
.c_str());
48 get_numeric_argument
<uint32_t>(LS
, 6, bgc
, fname
.c_str());
49 get_numeric_argument
<uint16_t>(LS
, 7, bga
, fname
.c_str());
50 std::string text
= get_string_argument(LS
, 3, fname
.c_str());
51 lua_render_ctx
->queue
->add(*new render_object_text(_x
, _y
, text
, fgc
, fga
, bgc
, bga
));