SoftLEASH game engine logo

WIKI

LUA / LÖVE

SOFTLEASH / DOCUMENTATION

Tween Manager

Move between values with clear timing and easing.

A working outline. The snippets below use plain LÖVE and Lua, not the final SoftLEASH API.

Overview

Tweens describe a change from one value to another over time. They are a useful building block for UI movement, feedback, and small animated details.


Add the actual tween creation, easing, completion, and cancellation API here. The example below interpolates a position with plain Lua and LÖVE rather than calling a SoftLEASH method.


LÖVE example

A small, plain LÖVE example for the draft. Replace this snippet with the documented SoftLEASH API and a focused use case later.


local g = love.graphics
local progress = 0

function love.update(dt)
    progress = math.min(
        progress + dt / 2, 1
    )
end

function love.draw()
    local x = 40 + 200 * progress
    g.rectangle(
        "fill", x, 100, 24, 24
    )
end
local g = love.graphics
local progress = 0

function love.update(dt)
    progress = math.min(
        progress + dt / 2, 1
    )
end

function love.draw()
    local x = 40 + 200 * progress
    g.rectangle(
        "fill", x, 100, 24, 24
    )
end
local g = love.graphics
local progress = 0

function love.update(dt)
    progress = math.min(
        progress + dt / 2, 1
    )
end

function love.draw()
    local x = 40 + 200 * progress
    g.rectangle(
        "fill", x, 100, 24, 24
    )
end


What to document next

  • Start and target values.

  • Duration, easing, and completion callbacks.

  • Replacing or cancelling an active tween.

SOFTLEASH / A GO DOG! TOOL

DOCUMENTATION IN PROGRESS

DOCUMENTATION IN PROGRESS