And the battle was never-ending until someone came up with a solution "Why not instead have something like a "cross-mode" GUI??? The people who like retained-mode will use the retained-architecture and the imgui people will use the immediate-model!"
Lavis aims just that - to allow the user to create GUIs in any way they wish which makes it a cross-mode GUI library. Let's say you want a image-button that when clicked says 'button pressed'. Here's how you might do this with Lavis:
In Retained Mode:
Code: Select all
lavis=require 'lavis'
lavis.imageButton('button.png',400,300):addEventListener('click',function()
print('button clicked')
end)
Code: Select all
lavis=require 'lavis'
function love.draw()
lavis.drawImageButton(1,'button.png',400,300) --id for this button is 1
end
lavis.imgui.onClick=function(id)
if id==1 then print('button clicked') end
end
Here's a look of GUI created with Lavis:-
Github-link
Read the documenation here
Note: Currently only the minimal version has been uploaded. Still it's powerful enough for you to create your own custom widgets!