6 struct render_object_text
: public render_object
8 render_object_text(int32_t _x
, int32_t _y
, const std::string
& _text
, uint32_t _fg
= 0xFFFFFFFFU
,
9 uint16_t _fgalpha
= 255, uint32_t _bg
= 0, uint16_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
, uint32_t _fg
,
23 uint16_t _fgalpha
, uint32_t _bg
, uint16_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 class lua_gui_text
: public lua_function
40 lua_gui_text() : lua_function("gui.text") {}
41 int invoke(lua_State
* LS
)
46 uint32_t fgc
= (x255
<< lua_render_ctx
->rshift
) | (x255
<< lua_render_ctx
->gshift
) |
47 (x255
<< lua_render_ctx
->bshift
);
51 int32_t _x
= get_numeric_argument
<int32_t>(LS
, 1, "gui.text");
52 int32_t _y
= get_numeric_argument
<int32_t>(LS
, 2, "gui.text");
53 get_numeric_argument
<uint32_t>(LS
, 4, fgc
, "gui.text");
54 get_numeric_argument
<uint16_t>(LS
, 5, fga
, "gui.text");
55 get_numeric_argument
<uint32_t>(LS
, 6, bgc
, "gui.text");
56 get_numeric_argument
<uint16_t>(LS
, 7, bga
, "gui.text");
57 std::string text
= get_string_argument(LS
, 3, "gui.text");
58 lua_render_ctx
->queue
->add(*new render_object_text(_x
, _y
, text
, fgc
, fga
, bgc
, bga
));