Hello,
I wrote some stuff I think it might help you out.
local sx, sy = guiGetScreenSize()
local progress = 0;
local borderY = 0;
local animState = 0
local panelTick = getTickCount()
function animatePanel()
local tick = getTickCount() - panelTick
local progress = tick/1000
if progress >= 1 then -- anim finished
--togglePanel() -- uncomment if you want it to go back down once the animation finishes
end
if animState == 1 then
borderY = interpolateBetween ( sy/1, 0, 0, sy/1.15, 0, 0, progress, "Linear")
else
borderY = interpolateBetween ( sy/1.15, 0, 0, sy/1, 0, 0, progress, "Linear")
end
dxDrawRectangle ( 0, borderY, sx, 100, tocolor(0,0,0,255),false) -- panel
end
function togglePanel()
if animState == 0 then
animState = 1 -- opening
else
animState = 0 -- closing
end
panelTick = getTickCount()
removeEventHandler("onClientRender",getRootElement(),animatePanel)
addEventHandler("onClientRender",getRootElement(),animatePanel)
end
addCommandHandler("tog", togglePanel)