I have 1 miniwindow that I am attempted to write text to. I have two functions that draw text to the window, and one of them is working fine. It draws text, and when it's time to change the text it draws a rectangle to "erase" the text, then writes more text on top. The second function does the same thing except this one draws text to the right of the first text area. The problem lies here, as the text is written fine, but the rectangle it draws to cover up the text is draw on top of the text. The text is never seen. I'v fiddled with this for quite a while and I just cannot get it working. Why does my first function work correctly and the second function does not?
function draw_conc (name, line, wildcards, styles)
local left = 0
for _, v in ipairs (styles) do
local width = WindowTextWidth (win, "f", v.text)
local right = left + width
WindowRectOp (win, miniwin.rect_fill, left, 0, 344, 0, v.backcolour) -- draw background
WindowText(win, "f", v.text, left, 3, 0, 0, v.textcolour, false)
left = left + width
end -- for each style run
WindowShow(win, true)
end
function draw_aura (name, line, wildcards, styles)
local left = 344 + 20
for _, v in ipairs (styles) do
local width = WindowTextWidth (win, "f", v.text)
local right = left + width
WindowRectOp (win, miniwin.rect_fill, left, 0, 344, 0, ColourNameToRGB("black")) -- draw background
WindowText(win, "f", v.text, left, 3, 0, 0, v.textcolour, false)
left = left + width
end -- for each style run
WindowShow(win, true)
end
|