@adnzzzzZ Well yes, this is a solution. I would recommed both solution. One for easy handling and the one you suggest for better control.
About the consoles...would be nice to use with computercraft -> https://github.com/Sorroko/cclite
[Library] Thranduil
Re: [Library, WIP] Thranduil
Last edited by SiENcE on Sat Mar 21, 2015 11:16 am, edited 1 time in total.
Re: [Library] Thranduil
Updated this with a bunch of new stuff, most notably:
Documentation
- Added Checkbox element
- Added Slider element
- Added Scrollarea element
- Added Textarea element
- Removed Textinput element (Textinput = Textarea with line height = 1)
Documentation
- Jasoco
- Inner party member
- Posts: 3725
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: [Library] Thranduil
I wonder how hard it would be to implement this into my map editor.
Re: [Library] Thranduil
That depends on what you wanna do. If it's just placing simple UI elements around then it should be pretty easy, like:Jasoco wrote:I wonder how hard it would be to implement this into my map editor.
Code: Select all
function init()
button = UI.Button(x, y, w, h, settings)
end
function update(dt)
button:update(dt)
if button.pressed then
doEditorButtonThing()
end
end
function draw()
button:draw()
end
---
Also, I made a Chatbox example to show how to create more complex UI objects using the library. Basically you just create an object of your own that will contain multiple simple UI objects, like buttons, sliders, textareas and so on. Then you create some logic to coordinate between them and get the desired behavior of the complex UI object you wanna create. In this case the Chatbox uses 2 textareas (one input area where the user types and one that is the chat log), 1 scrollarea to make it so that the chat log can be scrolled, and 1 button that can be used to send the message from the textinput to the chat log (can also do it with enter though).
- Attachments
-
- chatbox.love
- (363.49 KiB) Downloaded 143 times
- Jasoco
- Inner party member
- Posts: 3725
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: [Library] Thranduil
Well see I'd need to be able to add list items to a scrolling clickable list box that have the ability to have a custom icon that can be changed on the fly (Animated) with possibly two lines of text next to it in different fonts. As well as a list box that's just the icons. Each button would optionally have a tooltip too. Right now I have it working fine myself.
I'd also need popdown lists and other things. Right now my rudimentary GUI is working fine, and I've written my own custom GUI libraries before. I might just do that again. Usually I need to do a lot of demanding custom things which is why I end up writing most of my own libraries. Like my state stack manager, which I actually use to create the popdown menus and other GUI elements right now. I don't really know how well a stock GUI library would cooperate with my state stack anyway. lol
I'd also need popdown lists and other things. Right now my rudimentary GUI is working fine, and I've written my own custom GUI libraries before. I might just do that again. Usually I need to do a lot of demanding custom things which is why I end up writing most of my own libraries. Like my state stack manager, which I actually use to create the popdown menus and other GUI elements right now. I don't really know how well a stock GUI library would cooperate with my state stack anyway. lol
Re: [Library] Thranduil
I don't think it makes sense for you to try to use this because you seem to already have things working and you'd need to do a lot of work to get your specific UI elements working with this. Everything you mentioned can be done: scrollable clickable list box = scrollarea + buttons inside it that will be each element on that list; tooltip = making a textarea visible (inside a frame if you want it to be closeable) whenever .hot is set to true on a button; popdown list = 2 buttons to make the top of the popdown thingy and then when you click either it expands to a bigger frame with buttons inside it composing the list; state stack manager = completely on your side of things so it's all work you'd have to do kinda unrelated to the library... And so on. But doing all this is just a lot of work and if you already have those things working I don't know if there's any value in rewriting them?
Re: [Library] Thranduil
I found a small mistake in the current version:
UI.lua:5
should be
UI.lua:5
Code: Select all
UI.Input = require(ui_path .. 'input/Input')
Code: Select all
UI.Input = require(ui_path .. 'Input/Input')
Re: [Library] Thranduil
Hi there.
I used Thranduil in a game jam this weekend. It did its job, so thanks for that.
I didn't quite understand how to make button labels, so I did paint over the buttons using love.graphics.print(). Is it supposed to work like this?
I noticed a bug with buttons:
If the mouse cursor is already over the button when the button appears, then it is impossible to click the button.
I used Thranduil in a game jam this weekend. It did its job, so thanks for that.
I didn't quite understand how to make button labels, so I did paint over the buttons using love.graphics.print(). Is it supposed to work like this?
I noticed a bug with buttons:
If the mouse cursor is already over the button when the button appears, then it is impossible to click the button.
-
- Prole
- Posts: 3
- Joined: Sun Jun 07, 2015 3:31 am
Re: [Library] Thranduil
Thank you so much, If I ever get around to releasing my game you get a prime spot on in the credits.
I needed a GUI library and looking around I found yours and love frames on the wiki as the two with 9.x support.
The fact that yours accomplishes so much with so little (user) code is really cool,
it felt like using a library whereas love frames felt like learning an entire new language.
Huge props on the documentation and examples.
I needed a GUI library and looking around I found yours and love frames on the wiki as the two with 9.x support.
The fact that yours accomplishes so much with so little (user) code is really cool,
it felt like using a library whereas love frames felt like learning an entire new language.
Huge props on the documentation and examples.
- parallax7d
- Citizen
- Posts: 82
- Joined: Wed Jul 02, 2014 11:44 pm
Re: [Library] Thranduil
This library is magnificent, thanks for the thought and effort you put into it. I'm leaning towards using it in my project. What are your expectations as to future support and development on this lib? The docs are very nice, but would you consider making a comprehensive interactive demo?
Who is online
Users browsing this forum: Ahrefs [Bot] and 69 guests