2018-06-13 14:25:00 -05:00
2018-06-13 14:25:00 -05:00
2018-05-24 13:58:56 -05:00
2018-06-13 14:25:00 -05:00
2018-06-09 14:39:33 -05:00
2018-05-24 13:58:56 -05:00
2018-06-13 14:12:02 -05:00
2018-06-08 13:48:49 -05:00

JUI Library

A library that adds simple GUI elements for you to utilize in your Love2D games.

Basic Setup

Download the library and place the JUI folder in your project, the library can be required with:

local JUI = require("JUI/JUIlib") -- I recommend calling the required variable "JUI"
-- that's what I'll be using in all docs and examples

To set up a basic UI scene, a JUIScene is created and objects to be rendered are parented to it. The JUIScene must be rendered and updated inside the appropriate Love2D functions.

The full API docs can be found in the API.md file.

-- creates a UIContainer and a Frame object, and renders them.
local scene = JUI.JUIScene:new()

local frame = JUI.Frame:new()
    frame:setName("BackgroundFrame")
    frame:setBackgroundColor(JUI.Color:new(1, 0.5, 0.5))

-- connect a new event listener
frame.mouseEnter:connect(function()

end)

JUI:parent(scene, frame) -- the current method of setting the parent of an object
-- first object is the new parent of the second object
-- I don't particularly like this method, and am looking for an alternative

function love.update(delta)
    scene:update(delta) -- the UIContainer will recursively call update(delta) on all descendants
end

function love.draw()
    scene:render() -- same thing with render()
end

Other Information

Credits:

This project utilizes the YACI library. https://github.com/jpatte/yaci.lua

Description
Love2D GUI library, with some other tools.
Readme 103 KiB
Languages
Lua 100%