Difference between revisions of "Gwee"

(Created page with "Gwee is a small GUI toolkit for love2d. Gwee's widget set is currently ''very'' small and still a little buggy, but it has a couple of cool features: * Skinning * XML widget la...")
 
Line 5: Line 5:
 
* Skinning
 
* Skinning
 
* XML widget layouts
 
* XML widget layouts
 +
 +
Here is a small example program:
 +
 +
<source lang="lua">
 +
require "gwee"
 +
 +
function sayHi()
 +
    print("Hi!")
 +
end
 +
 +
function love.load()
 +
    gui = gwee.GUI()
 +
    gui:add(gwee.Button(100, 100, 100, 30, "Button!", sayHi))
 +
    gui:add(gwee.TextField(100, 100, 100, 30, "Text Field:"))
 +
end
 +
 +
function love.keypressed(key, unicode)
 +
    gui:keypressed(key, unicode)
 +
end
 +
 +
function love.mousepressed(x, y, button)
 +
    gui:mousepressed(x, y, button)
 +
end
 +
 +
function love.update(dt)
 +
    gui:update(dt)
 +
end
 +
 +
function love.draw()
 +
    gui:draw()
 +
end
 +
</source>
  
 
More information can be found in the [http://github.com/ZephyrMC/Gwee/blob/master/README README] and the [http://github.com/ZephyrMC/Gwee/blob/master/API.txt API documentation].
 
More information can be found in the [http://github.com/ZephyrMC/Gwee/blob/master/README README] and the [http://github.com/ZephyrMC/Gwee/blob/master/API.txt API documentation].

Revision as of 23:21, 7 December 2011

Gwee is a small GUI toolkit for love2d.

Gwee's widget set is currently very small and still a little buggy, but it has a couple of cool features:

  • Skinning
  • XML widget layouts

Here is a small example program:

require "gwee"

function sayHi()
    print("Hi!")
end

function love.load()
    gui = gwee.GUI()
    gui:add(gwee.Button(100, 100, 100, 30, "Button!", sayHi))
    gui:add(gwee.TextField(100, 100, 100, 30, "Text Field:"))
end

function love.keypressed(key, unicode)
    gui:keypressed(key, unicode)
end

function love.mousepressed(x, y, button)
    gui:mousepressed(x, y, button)
end

function love.update(dt)
    gui:update(dt)
end

function love.draw()
    gui:draw()
end

More information can be found in the README and the API documentation.

You can get Gwee from the Github repository.