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)
end)
anim:
Start(
2)
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