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...")
 
m (Other Languages)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== SUIT - The Simple User Interface Toolkit for LÖVE ==
+
SUIT - The Simple User Interface Toolkit for LÖVE. Make games, not GUIs!
  
Make games, not GUIs!
+
SUIT supports layouts and themes.
 
 
SUIT gives you:
 
  
 +
== Widgets ==
 
* Buttons
 
* Buttons
 
* Image Buttons
 
* Image Buttons
Line 10: Line 9:
 
* Text input boxes
 
* Text input boxes
 
* Checkboxes
 
* Checkboxes
* Cake
 
 
* Sliders
 
* Sliders
* Layouts
 
* Themes
 
* World Peace!
 
  
Well, at least eight of those things.
+
== Examples ==
 +
=== Input and a button demo ===
 +
<source lang="lua">
 +
suit = require 'suit'
  
Here is some Code:
+
local input = {text = ""}
  
  suit = require 'suit'
+
function love.update(dt)
 
+
    suit.layout.reset(100,100)
  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
 
  
Documentation at readthedocs: http://suit.readthedocs.org/en/latest/
+
    suit.Input(input, suit.layout.row(200,30))
 +
    suit.Label("Hello, "..input.text, {align = "left"}, suit.layout.row())
  
Code at github: https://github.com/vrld/SUIT
+
    suit.layout.row() -- padding of one cell
 +
    if suit.Button("Close", suit.layout.row()).hit then
 +
        love.event.quit()
 +
    end
 +
end
  
Forum post: http://love2d.org/forums/viewtopic.php?f=5&t=81522
+
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}}
Line 58: Line 52:
 
{{#set:Description=Simple User Interface Toolkit}}
 
{{#set:Description=Simple User Interface Toolkit}}
 
{{#set:Keyword=GUI}}
 
{{#set:Keyword=GUI}}
 +
{{#set:Standalone_Lua_Module=Yes}}
 
[[Category:Libraries]]
 
[[Category:Libraries]]
 +
 +
== Other Languages ==
 +
{{i18n|SUIT}}

Latest revision as of 01:26, 16 December 2019

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

Links

Other Languages