Simplify - simple Event-driven GUI library
Posted: Fri Jun 30, 2017 5:13 pm
Repository: https://github.com/mastermarkus/simplify
Documantation: https://github.com/mastermarkus/simplify/wiki
Simplify is a simple Event-driven GUI library for Löve2D. With this library you can simply create GUI elements and listen for mouse and keyboard input. This library also support's ZIndex drawing order system, where you can specify the display order of GUI elements.
Quick example:
Listening for mouse events
The main purpose of this project is to make development of Gui easier and more fun. Right now, there's no documentation, but it's pretty straightforward, by simply looking at "Simplify.lua" main file and other class modules.
In future i plan to add Gui groups. Lets say you have minimap or inventory UI in your game and you want them to always to stay on top of
other Guis, well that's the point of Gui groups,they have their specific MasterZIndex and then children are individual GUI elements, that also have regular ZIndex property.
Because i do this all myself, it takes a lot of time and i would be glad if you are willing to contribute to the repositiory bug fixes, new features etc...
Documantation: https://github.com/mastermarkus/simplify/wiki
Simplify is a simple Event-driven GUI library for Löve2D. With this library you can simply create GUI elements and listen for mouse and keyboard input. This library also support's ZIndex drawing order system, where you can specify the display order of GUI elements.
Quick example:
Code: Select all
function love.load()
simplify = require('simplify')
local testbutton = simplify:TextButton(200,100)--size paramters
--testbutton:SetSize(500,500) you can also set size at any time with :SetSize()
testbutton:SetTextXAlignment("Center")-- "Left", "Center", "Right"
testbutton:SetTextYAlignment("Center")-- "Top", "Center", "Bottom"
testbutton:SetPosition(300,300)
testbutton:SetText("Hello world!")
testbutton:SetTextColor(0,0,255)--Blue text ,you cant set alpha with this method directly
testbutton:SetBorderSizePixel(5)
testbutton:SetBorderColor(255,0,0)
testbutton:SetBackgroundColor(70,70,70) -- grey background
end
Code: Select all
testbutton.MouseButton1Down:connect(function(x,y)--return where mouse clicked on button
print("Mouse Clicked at X: "..x.." Y:"..y)
end)
testbutton.MouseEnter:connect(function(x,y)--return where mouse entered on button
print("Mouse Enteres at X: "..x.." Y:"..y)
end)
The main purpose of this project is to make development of Gui easier and more fun. Right now, there's no documentation, but it's pretty straightforward, by simply looking at "Simplify.lua" main file and other class modules.
In future i plan to add Gui groups. Lets say you have minimap or inventory UI in your game and you want them to always to stay on top of
other Guis, well that's the point of Gui groups,they have their specific MasterZIndex and then children are individual GUI elements, that also have regular ZIndex property.
Because i do this all myself, it takes a lot of time and i would be glad if you are willing to contribute to the repositiory bug fixes, new features etc...