Animation Overview

Animation System Updated: Dec 10, 2025

Animation System

Smooth animations with easing functions.

Basic Animation

cLib.Animate({
    from = 0,
    to = 255,
    duration = 0.5,
    ease = cLib.Ease.OutQuad,
    onUpdate = function(value)
        panel:SetAlpha(value)
    end,
    onComplete = function()
        print("Done!")
    end
})

Options

OptionTypeDescription
fromnumberStart value
tonumberEnd value
durationnumberDuration in seconds
easefunctionEasing function
delaynumberDelay before start
onUpdatefunctionCalled each frame
onCompletefunctionCalled when done

Animate Multiple Values

cLib.AnimateMultiple({
    from = {x = 0, y = 0, scale = 0.5},
    to = {x = 100, y = 50, scale = 1},
    duration = 0.3,
    ease = cLib.Ease.OutBack,
    onUpdate = function(values)
        panel:SetPos(values.x, values.y)
        panel:SetScale(values.scale)
    end
})

Animate Colors

cLib.AnimateColor({
    from = Color(255, 0, 0),
    to = Color(0, 255, 0),
    duration = 1,
    onUpdate = function(color)
        panel.bgColor = color
    end
})

Control Animations

-- Start animation (returns ID)
local animId = cLib.Animate({...})

-- Stop animation
cLib.StopAnimation(animId)

-- Check if running
if cLib.IsAnimating(animId) then
    print("Still animating...")
end

-- Get current value
local value = cLib.GetAnimationValue(animId)