Skip to content
KyonruPublic

About

ui framework for love2d

Topics

Resources

Accessibility

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

glyph.lua

Declarative UI for Love2D 11.x, shaped for game HUDs, debugger panels, editor tools, and in-game menus.

Glyph is a small UI engine for games: layout, styling, input, animation, feedback, scenes, accessibility metadata, and game-friendly drawing primitives live in core; game-specific widgets stay in examples or app code.

Documentation

Read the public docs at https://kyonru.github.io/glyph.lua/.

The same documentation lives locally in docs/.

Preview

Animated GIF showing the Glyph inventory example with potion drag and drop.

Quick Start

Copy glyph.lua and the glyph/ directory into a Love2D project, then create this main.lua:

local ui = require("glyph")

local function App()
  local count, setCount = ui.useState(0)

  return ui.panel({ title = "Mission Console", width = 360, padding = 12, gap = 10 }, {
    ui.row({ gap = 8, align = "center" }, {
      ui.button({
        label = "Increment",
        onClick = function()
          setCount(count + 1)
        end,
      }),
      ui.text("Count: " .. tostring(count)),
    }),
  })
end

function love.load()
  ui.load({
    window = {
      width = 640,
      height = 360,
      resizable = true,
      title = "Glyph App",
    },
    app = App,
  })
end

Run it from the project directory:

love .

Passing app = App to ui.load installs Glyph's update, draw, pointer, keyboard, touch, wheel, and resize callbacks. Do not also call ui.update or ui.render from your Love2D callbacks when using this automatic setup.

Glyph has no required runtime dependency beyond Love2D 11.x. Optional adapters such as Push/Shove viewport backends, SYSL rich text, and anim8 sprite animations are app-provided.

Examples

Run an example with Love2D:

love examples/basic
love examples/inventory
love examples/path-feedback

See the full examples guide in docs/examples.md.

Development

Run tests:

make test
# or directly
.luarocks/bin/busted

Syntax-check Lua files:

luac -p glyph.lua glyph/*.lua examples/*/main.lua examples/*/example.lua spec/*_spec.lua

Serve the docs locally:

make docs

About

ui framework for love2d

Topics

Resources

Accessibility

Stars

1 star

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages