Immediate Mode GUI library for LÖVE
Find a file
Whitecl4ws 8404c2ff79 Added both password and label support
Label is set only once when the focus is not on the box, it can also be reset by setting the label again (the label is set to "" when the focus is on the input)
Password can also be toggled on and off depending on your needs
2017-01-28 11:33:10 -05:00
docs Document new GUI state getters 2016-08-28 19:20:49 +02:00
.gitignore LET THERE BE SUIT! 2015-12-31 18:23:52 +01:00
button.lua Allow to overwrite draw function per widget 2016-01-16 02:33:41 +01:00
checkbox.lua Allow to overwrite draw function per widget 2016-01-16 02:33:41 +01:00
core.lua Fix #34: Add [is,any][Hit,Active,Hovered]() 2016-08-28 19:16:29 +02:00
imagebutton.lua Allow to overwrite draw function per widget 2016-01-16 02:33:41 +01:00
init.lua Fix #34: Add [is,any][Hit,Active,Hovered]() 2016-08-28 19:16:29 +02:00
input.lua Added both password and label support 2017-01-28 11:33:10 -05:00
label.lua Allow to overwrite draw function per widget 2016-01-16 02:33:41 +01:00
layout.lua Merge pull request #45 from Alloyed/fix-layout-pop 2016-08-28 18:13:52 +02:00
license.txt LET THERE BE SUIT! 2015-12-31 18:23:52 +01:00
README.md Update README.md 2017-01-28 11:28:01 -05:00
slider.lua Allow to overwrite draw function per widget 2016-01-16 02:33:41 +01:00
theme.lua Fix #43 by enforcing minimum size on box drawing 2016-08-28 18:33:40 +02: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 = ""}

-- By default, backspace only registers once, if you want classic GUI backspace that
-- Keeps removing chars when pushed down, add this line: love.keyboard.setKeyRepeat(true)

-- 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.textinput(t)
	-- forward text input to SUIT
	suit.textinput(t)
end

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