Lavis: Cross-Mode Library for Love2d
Posted: Wed Dec 04, 2019 12:36 pm
Retained GUI, ImGUI, Retained GUI, ImGUI, .....
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:
In Immediate Mode:
And this is the complete code not part of the code!! It's not that Lavis takes control of the runtime it's just that Lavis overrides love functions with its own functions so you don't have to redefine them if you don't need them!!
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!
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!