SoftLEASH game engine logo

WIKI

LUA / LÖVE

SOFTLEASH / DOCUMENTATION

Layered Rendering

Make draw order explicit, from the background to the last UI element.

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

Overview

Layered rendering gives each visual element a predictable place in the draw order. Backgrounds, world objects, effects, and UI can be organized without relying on accidental object order.


Describe layer creation, sorting, camera behavior, and per-layer options here. The example uses LÖVE’s immediate draw order: later shapes appear over earlier ones.


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

function love.draw()
    g.setColor(0.3, 0.61, 0.9)
    g.rectangle(
        "fill", 24, 24, 240, 160
    )
    g.setColor(1, 0.77, 0.15)
    g.rectangle(
        "fill", 72, 72, 96, 64
    )
    g.setColor(1, 1, 1)
    g.print("UI drawn last", 40, 40)
end
local g = love.graphics

function love.draw()
    g.setColor(0.3, 0.61, 0.9)
    g.rectangle(
        "fill", 24, 24, 240, 160
    )
    g.setColor(1, 0.77, 0.15)
    g.rectangle(
        "fill", 72, 72, 96, 64
    )
    g.setColor(1, 1, 1)
    g.print("UI drawn last", 40, 40)
end
local g = love.graphics

function love.draw()
    g.setColor(0.3, 0.61, 0.9)
    g.rectangle(
        "fill", 24, 24, 240, 160
    )
    g.setColor(1, 0.77, 0.15)
    g.rectangle(
        "fill", 72, 72, 96, 64
    )
    g.setColor(1, 1, 1)
    g.print("UI drawn last", 40, 40)
end


What to document next

  • Declaring layers and their order.

  • Sorting objects within a layer.

  • World-space and screen-space drawing.

SOFTLEASH / A GO DOG! TOOL

DOCUMENTATION IN PROGRESS

DOCUMENTATION IN PROGRESS