that doesn't work correctly ...
i tried your way like this:
local screenW, _ = guiGetScreenSize ()
local TABLE = {}
local POSITION = 0
function txt (text)
POSITION = POSITION + 20
table.insert (TABLE, {text, 0})
setTimer (function ()
setTimer (function ()
if POSITION > 0 then
POSITION = POSITION - 1
for i, v in pairs (TABLE) do
TABLE[i] = {v[1], v[2] - 1}
if v[2] <= 0 then
table.remove (TABLE, i)
end
end
end
end, 50, 20)
end, 5000, 1)
end
addEventHandler ("onClientPreRender", root,
function ()
for i, v in pairs (TABLE) do
dxDrawRectangle ((screenW - 563)/2, (i-1) * 20, 563, 21, tocolor (0, 0, 0, 180))
dxDrawText (v[1], (screenW - 450)/2, (i-1) * 20, (screenW - 448) / 2 + 448, v[2], tocolor (255, 0, 0, 255), 1, "default-bold", "center", "center", true, false, false, true)
end
end
)
but it's not moving slowly down it just appears, also the text doesn't fit the rectangle it shows up above the rectangle
my code above makes the text and the rectangle moving slowly down till it shows to you
so .. any other ways or helps ?