diff options
author | cracyc <cracyc@users.noreply.github.com> | 2018-11-03 17:03:19 -0500 |
---|---|---|
committer | cracyc <cracyc@users.noreply.github.com> | 2018-11-03 17:03:19 -0500 |
commit | b311dfeaf82251dc6915edbc4e421c698427f9ab (patch) | |
tree | 60595a9d0fe880a70f91c2e0a0fe0ea755313a14 /src/frontend/mame/luaengine.cpp | |
parent | a01add15ffde91ef6d3d7b7e78786590071618b0 (diff) |
luaengine: background color for draw_text (nw)
Diffstat (limited to 'src/frontend/mame/luaengine.cpp')
-rw-r--r-- | src/frontend/mame/luaengine.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp index 0f0728902e1..697726f19a4 100644 --- a/src/frontend/mame/luaengine.cpp +++ b/src/frontend/mame/luaengine.cpp @@ -1727,9 +1727,9 @@ void lua_engine::initialize() })); /* machine.screens[screen_tag] - * screen:draw_box(x1, y1, x2, y2, fillcol, linecol) - draw box from (x1, y1)-(x2, y2) colored linecol filled with fillcol + * screen:draw_box(x1, y1, x2, y2, fillcol, linecol) - draw box from (x1, y1)-(x2, y2) colored linecol filled with fillcol, color is 32bit argb * screen:draw_line(x1, y1, x2, y2, linecol) - draw line from (x1, y1)-(x2, y2) colored linecol - * screen:draw_text(x || justify, y, message, [opt] color) - draw message at (x, y) or at line y with left, right, center justification + * screen:draw_text(x || justify, y, message, [opt] fgcolor, [opt] bgcolor) - draw message at (x, y) or at line y with left, right, center justification * screen:height() - screen height * screen:width() - screen width * screen:orientation() - screen angle, flipx, flipy @@ -1763,7 +1763,7 @@ void lua_engine::initialize() y2 = std::min(std::max(0.0f, y2), float(sc_height-1)) / float(sc_height); sdev.container().add_line(x1, y1, x2, y2, UI_LINE_WIDTH, rgb_t(color), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); }, - "draw_text", [this](screen_device &sdev, sol::object xobj, float y, const char *msg, sol::object color) { + "draw_text", [this](screen_device &sdev, sol::object xobj, float y, const char *msg, sol::object color, sol::object bcolor) { int sc_width = sdev.visible_area().width(); int sc_height = sdev.visible_area().height(); auto justify = ui::text_layout::LEFT; @@ -1787,12 +1787,13 @@ void lua_engine::initialize() return; } rgb_t textcolor = UI_TEXT_COLOR; - rgb_t bgcolor = UI_TEXT_BG_COLOR; + rgb_t bgcolor = 0; if(color.is<uint32_t>()) textcolor = rgb_t(color.as<uint32_t>()); + if(bcolor.is<uint32_t>()) + bgcolor = rgb_t(bcolor.as<uint32_t>()); mame_machine_manager::instance()->ui().draw_text_full(sdev.container(), msg, x, y, (1.0f - x), - justify, ui::text_layout::WORD, mame_ui_manager::NORMAL, textcolor, - bgcolor, nullptr, nullptr); + justify, ui::text_layout::WORD, mame_ui_manager::OPAQUE_, textcolor, bgcolor); }, "height", [](screen_device &sdev) { return sdev.visible_area().height(); }, "width", [](screen_device &sdev) { return sdev.visible_area().width(); }, |