Derma_Anim
Example
Applies an easeInQuad easing to the panel to make it glide naturally across the screen.
local function inQuad(fraction, beginning, change)
return change * (fraction ^ 2) + beginning
end
local main = vgui.Create("DFrame")
main:SetTitle("Derma_Anim Example")
main:SetSize(250, 200)
main:SetPos(200)
main:MakePopup()
local anim = Derma_Anim("EaseInQuad", main, function(pnl, anim, delta, data)
pnl:SetPos(inQuad(delta, 200, 600), 300) -- Change the X coordinate from 200 to 200+600
end)
anim:Start(2) -- Animate for two seconds
main.Think = function(self)
if anim:Active() then
anim:Run()
end
end
Output: Panel naturally glides across the screen from 200 x to 800 x