Page 1 of 2
HTML+CSS UI Rendering
Posted: Fri Mar 10, 2023 10:11 am
by qurs
Hello there!
I'm looking for a tool to create a UI using HTML+ CSS. I only came across LURE, but in 10 years it has undergone changes, while the article on the love2d wiki has remained unchanged. And I am confused, I do not know how to use it, there is nowhere at least a brief instruction on how to use it.
Are there anyone here who knows how to use LURE or knows alternatives?
LURE -
https://github.com/rdlaitila/LURE
I'm sorry if I wrote in the wrong place, I'm new to your forum. Thank you in advance!
Re: HTML+CSS UI Rendering
Posted: Fri Mar 10, 2023 1:07 pm
by Andlac028
First of all, why you would like to create UI in HTML and CSS and at same time, use Love and Lua?
In my opinion, HTML and CSS can get too complicated to be supported (okay, maybe few features may be supported, but not entire renderer with all tags and style properties etc). I would either use Lua and Love, or do web app using HTML, CSS and JS.
What you would like to accomplish with it?
Re: HTML+CSS UI Rendering
Posted: Fri Mar 10, 2023 1:12 pm
by qurs
Andlac028 wrote: ↑Fri Mar 10, 2023 1:07 pm
First of all, why you would like to create UI in HTML and CSS and at same time, use Love and Lua?
In my opinion, HTML and CSS can get too complicated to be supported (okay, maybe few features may be supported, but not entire renderer with all tags and style properties etc). I would either use Lua and Love, or do web app using HTML, CSS and JS.
What you would like to accomplish with it?
It's more convenient for me to work with the interface through HTML and CSS, besides, I have a friend who makes an incredible design using HTML and CSS. Unfortunately, Lua cannot provide a convenient ground for creating interfaces.
Besides, did the creator of LURE somehow implement this? So it's still possible..
Re: HTML+CSS UI Rendering
Posted: Fri Mar 10, 2023 5:08 pm
by Xugro
qurs wrote: ↑Fri Mar 10, 2023 10:11 amI only came across LURE, [...] And I am confused, I do not know how to use it, there is nowhere at least a brief instruction on how to use it.
You cannot use it (yet):
If you want to use Lua as a scripting language, but use HTML and CSS for rendering, then take a look at
Fengari. With Fengari you can use Lua in the browser. If you want to use löve with HTML and CSS you have to write your own renderer.
qurs wrote: ↑Fri Mar 10, 2023 10:11 amUnfortunately, Lua cannot provide a convenient ground for creating interfaces.
An alternative is to use one of the GUI libraries that are listed in the wiki:
https://love2d.org/wiki/Graphical_User_Interface
Re: HTML+CSS UI Rendering
Posted: Fri Mar 10, 2023 5:13 pm
by qurs
Xugro wrote: ↑Fri Mar 10, 2023 5:08 pm
You cannot use it (yet):
Thanks. This is exactly the answer I needed. I don't know how I didn't notice that it wasn't finished =(
Re: HTML+CSS UI Rendering
Posted: Sun Mar 12, 2023 11:34 am
by dusoft
qurs wrote: ↑Fri Mar 10, 2023 1:12 pm
It's more convenient for me to work with the interface through HTML and CSS, besides, I have a friend who makes an incredible design using HTML and CSS. Unfortunately, Lua cannot provide a convenient ground for creating interfaces.
Besides, did the creator of LURE somehow implement this? So it's still possible..
You might want to rather learn Lua/LOVE graphics and/or look into LOVE UI libraries linked above. Even if some package does bring support of HTML/CSS, it won't be on par with browsers. It have taken years to built them and they still have hundreds of rendering bugs (!).
If you do some small subset of CSS, it might be possible, but you will still encounter rendering bugs that will fail your designs in the end.
I would recommend against it.
Re: HTML+CSS UI Rendering
Posted: Sun Mar 12, 2023 12:58 pm
by qurs
dusoft wrote: ↑Sun Mar 12, 2023 11:34 am
qurs wrote: ↑Fri Mar 10, 2023 1:12 pm
It's more convenient for me to work with the interface through HTML and CSS, besides, I have a friend who makes an incredible design using HTML and CSS. Unfortunately, Lua cannot provide a convenient ground for creating interfaces.
Besides, did the creator of LURE somehow implement this? So it's still possible..
You might want to rather learn Lua/LOVE graphics and/or look into LOVE UI libraries linked above. Even if some package does bring support of HTML/CSS, it won't be on par with browsers. It have taken years to built them and they still have hundreds of rendering bugs (!).
If you do some small subset of CSS, it might be possible, but you will still encounter rendering bugs that will fail your designs in the end.
I would recommend against it.
Thanks for the advice. I know about libraries (at least I found out while I was looking for information). I just know a few games that used HTML+CSS for some interface, found out about LURE and was very excited about this idea.
Re: HTML+CSS UI Rendering
Posted: Sun Mar 12, 2023 1:30 pm
by BrotSagtMist
This games most likely dont have their own html renderer.
You can import webkit for example quite easy and have it show pages or part of pages inside any window you want.
Re: HTML+CSS UI Rendering
Posted: Mon Mar 13, 2023 5:48 am
by dusoft
qurs wrote: ↑Sun Mar 12, 2023 12:58 pm
Thanks for the advice. I know about libraries (at least I found out while I was looking for information). I just know a few games that used HTML+CSS for some interface, found out about LURE and was very excited about this idea.
You can test the legacy version for your scenario:
A prior naive implimentation (sic!) was written many years ago and for reference purposes is found in the legacy folders of many of the project's sub-directories, which was capable of rendering some very primitive DOM elements and text.
Re: HTML+CSS UI Rendering
Posted: Mon Mar 13, 2023 5:50 am
by dusoft
Also since Lua support C++ binding, you might be able to use C++ for rendering HTML/CSS directly.