Difference between revisions of "SUIT"
(Created page with "== SUIT - The Simple User Interface Toolkit for LÖVE == Make games, not GUIs! SUIT gives you: * Buttons * Image Buttons * Labels * Text input boxes * Checkboxes * Cake * S...") |
(formatting changes) |
||
Line 1: | Line 1: | ||
− | + | SUIT - The Simple User Interface Toolkit for LÖVE. Make games, not GUIs! | |
− | + | SUIT supports layouts and themes. | |
− | |||
− | SUIT | ||
+ | == Widgets == | ||
* Buttons | * Buttons | ||
* Image Buttons | * Image Buttons | ||
Line 10: | Line 9: | ||
* Text input boxes | * Text input boxes | ||
* Checkboxes | * Checkboxes | ||
− | |||
* Sliders | * Sliders | ||
− | |||
− | |||
− | |||
− | + | == Examples == | |
+ | === Input and a button demo === | ||
+ | <source lang="lua"> | ||
+ | suit = require 'suit' | ||
+ | |||
+ | local input = {text = ""} | ||
+ | |||
+ | function love.update(dt) | ||
+ | suit.layout.reset(100,100) | ||
+ | |||
+ | suit.Input(input, suit.layout.row(200,30)) | ||
+ | suit.Label("Hello, "..input.text, {align = "left"}, suit.layout.row()) | ||
− | + | suit.layout.row() -- padding of one cell | |
+ | if suit.Button("Close", suit.layout.row()).hit then | ||
+ | love.event.quit() | ||
+ | end | ||
+ | end | ||
− | + | function love.draw() | |
− | + | suit.core.draw() | |
− | + | end | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | function love.textinput(t) | |
+ | suit.core.textinput(t) | ||
+ | end | ||
− | + | function love.keypressed(key) | |
+ | suit.core.keypressed(key) | ||
+ | end | ||
+ | </source> | ||
− | + | == Links == | |
+ | * [http://suit.readthedocs.org/en/latest/ Documentation] | ||
+ | * [https://github.com/vrld/SUIT Source code] | ||
+ | * [https://love2d.org/forums/viewtopic.php?f=5&t=81522 Forum thread] | ||
{{#set:LOVE Version=0.10.x}} | {{#set:LOVE Version=0.10.x}} |
Revision as of 02:33, 27 March 2016
SUIT - The Simple User Interface Toolkit for LÖVE. Make games, not GUIs!
SUIT supports layouts and themes.
Widgets
- Buttons
- Image Buttons
- Labels
- Text input boxes
- Checkboxes
- Sliders
Examples
Input and a button demo
suit = require 'suit'
local input = {text = ""}
function love.update(dt)
suit.layout.reset(100,100)
suit.Input(input, suit.layout.row(200,30))
suit.Label("Hello, "..input.text, {align = "left"}, suit.layout.row())
suit.layout.row() -- padding of one cell
if suit.Button("Close", suit.layout.row()).hit then
love.event.quit()
end
end
function love.draw()
suit.core.draw()
end
function love.textinput(t)
suit.core.textinput(t)
end
function love.keypressed(key)
suit.core.keypressed(key)
end