Immediate Mode GUI library for LÖVE
Find a file
2025-08-12 12:54:44 -04:00
docs Fix a sentence in docs 2019-02-01 23:05:22 +01:00
.gitignore LET THERE BE SUIT! 2015-12-31 18:23:52 +01:00
button.lua better support for custom color themes in button and label 2025-08-12 12:54:44 -04:00
checkbox.lua Allow to overwrite draw function per widget 2016-01-16 02:33:41 +01:00
core.lua core: require that the user manually call suit:enterFrame during update/draw so that manually specifying mouse coordinates works 2025-08-05 09:55:28 -04:00
imagebutton.lua Fixed ImageButton checking mask bounds on mask instead of image 2018-08-12 20:58:48 +02:00
init.lua fix 'Input widget will raise error when candidate_text field is not defined' 2017-10-31 19:38:14 +08:00
input.lua fix 'Input widget will raise error when candidate_text field is not defined' 2017-10-31 19:38:14 +08:00
label.lua better support for custom color themes in button and label 2025-08-12 12:54:44 -04:00
layout.lua layout: add newRow function, which increments the layout y position by the current cell height, while resetting the x position and internal width 2025-08-04 21:34:36 -04:00
license.txt LET THERE BE SUIT! 2015-12-31 18:23:52 +01:00
README.md fix 'Input widget will raise error when candidate_text field is not defined' 2017-10-31 19:38:14 +08:00
slider.lua Allow to overwrite draw function per widget 2016-01-16 02:33:41 +01:00
suit-0.1-1.rockspec Fix rockspec 2018-04-08 14:15:21 +02:00
theme.lua add 'scale' option support to drawing a button box 2025-08-12 12:54:19 -04:00

SUIT

Simple User Interface Toolkit for LÖVE.

SUIT is an immediate mode GUI library.

Documentation?

Over at readthedocs.

Looks?

Here is how SUIT looks like with the default theme:

Demo of all widgets

More info and code is over at readthedocs.

Hello, World!

-- suit up
local suit = require 'suit'

-- storage for text input
local input = {text = ""}

-- make love use font which support CJK text
function love.load()
    local font = love.graphics.newFont("NotoSansHans-Regular.otf", 20)
    love.graphics.setFont(font)
end

-- all the UI is defined in love.update or functions that are called from here
function love.update(dt)
	-- put the layout origin at position (100,100)
	-- the layout will grow down and to the right from this point
	suit.layout:reset(100,100)

	-- put an input widget at the layout origin, with a cell size of 200 by 30 pixels
	suit.Input(input, suit.layout:row(200,30))

	-- put a label that displays the text below the first cell
	-- the cell size is the same as the last one (200x30 px)
	-- the label text will be aligned to the left
	suit.Label("Hello, "..input.text, {align = "left"}, suit.layout:row())

	-- put an empty cell that has the same size as the last cell (200x30 px)
	suit.layout:row()

	-- put a button of size 200x30 px in the cell below
	-- if the button is pressed, quit the game
	if suit.Button("Close", suit.layout:row()).hit then
		love.event.quit()
	end
end

function love.draw()
	-- draw the gui
	suit.draw()
end

function love.textedited(text, start, length)
    -- for IME input
    suit.textedited(text, start, length)
end

function love.textinput(t)
	-- forward text input to SUIT
	suit.textinput(t)
end

function love.keypressed(key)
	-- forward keypresses to SUIT
	suit.keypressed(key)
end