Support for librocket - Page 3

Support for librocket

Requests for features in the spring code.

Moderator: Moderators

User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: Support for librocket

Post by SpliFF »

I've seen seen a couple of RCSS rules that don't exist in CSS3 but on the whole a standard HTML WYSIWYG is going to give a pretty reasonable approximation.

For the other questions the answer is basically yes, all those things are supported. The full list of elements and styles is on the librocket website. Yes the UI can be modified using scripting, yes things like drag and drop are supported, and yes, it should be integrated in a way the whole engine could use it (for built in settings, lobby, frontend etc).
Last edited by SpliFF on 21 Mar 2011, 12:39, edited 1 time in total.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Support for librocket

Post by hoijui »

the way i imagine it, this is most useful for independent widget creators that need GUI stuff.
lets say, i write a widgets with a small GUI; a graphical native AI spawner. you choose the team from a list, the AI type (AAI, KAIK, ...), and then press the [Run] button. I write this GUI in HTML without any style/CSS. This could then be used in BA and ZK, which both supply their CSS to make it visually fit in. maybe we can even find a way so the game can define a dedicated place on the screen where 3rd party widgets would place their GUIs, so it would not mess up the games default GUI stuff.

nice to hear you may jump into this spliff! :-)
finishing assimp first sounds like a good plan though.
User avatar
Licho
Zero-K Developer
Posts: 3803
Joined: 19 May 2006, 19:13

Re: Support for librocket

Post by Licho »

This sounds like a huge waste of effort.

And yes, chili does support automatic resizing ...

Improving chili is much more cost effective way, and games are already using it (ZK, S44, Gundam, EvoRTS, Cursed).
User avatar
koshi
Lobby Developer
Posts: 1059
Joined: 14 Aug 2007, 16:15

Re: Support for librocket

Post by koshi »

hoijui wrote:I write this GUI in HTML without any style/CSS. This could then be used in BA and ZK, which both supply their CSS to make it visually fit in
+X, where X >> 1
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

Re: Support for librocket

Post by SpliFF »

I understand that you are personally quite attached to chili and feel it is sufficient but I have to be frank with you - I think it's a pretty average GUI. Your comments assume that the underlying limits of the GUI can be solved with the same amount of effort it would take to hook up librocket but you really can't back that up nor can I dispute it so it's a pretty pointless argument to get into.

Again though you are completely ignoring the fact that Lua and chili are both completely alien concepts to most designers and any reliance on them means a steep learning curve. This fact alone makes librocket superior. If you then factor in that librocket also appears to be better documented and contains a richer set of style and widget options then the gap just widens.

If you feel chili is sufficient I can't change your mind but at the same time I simply don't buy into your claim. I am very impressed with the time and effort that has gone into all of Spring's existing GUI frameworks but all else being equal I would pick librocket for my own game every time.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Support for librocket

Post by Forboding Angel »

I'm afraid to get excited about this because my main worry is that my cock gets all hard and I end up with blueballs.

Suffice it to say, I'm pretty sure that most of us less talented content people would repeatedly blow loads over the functionality.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Support for librocket

Post by knorke »

I'm pretty sure that most of us less talented content people would repeatedly blow loads over the functionality.
What makes you think "less talented content people" know enough about webdesign to make this work? Its not so easy either.
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Re: Support for librocket

Post by SinbadEV »

knorke wrote:
I'm pretty sure that most of us less talented content people would repeatedly blow loads over the functionality.
What makes you think "less talented content people" know enough about webdesign to make this work? Its not so easy either.
Yes it is... You could probably learn to make HTML in your sleep and while initially frustrating, css is simple enough for your mother to learn.

Now... I'll grant that it's no easier to make it pretty it would be easier for you to find a talented web-designer then a talented "Lua programmer who is also a GUI programmer"
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Support for librocket

Post by Forboding Angel »

Because of what sinbad said, and I, being one of those less talented, know php/css/html.

Hey, while you're at it, replace lua with php :-)
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Support for librocket

Post by knorke »

The sample here: http://springrts.com/phpbb/viewtopic.ph ... 9&start=19 seems a bit more complicated then <h>My first Heading</h1>
Spring.Echo ("my first echo") :roll:
What I do not see in that example is something that decides where on the screen that menu gets drawn?

Just to understand, the above link would be a teamselect.html for example.
And on the widget side?
Like this? (just guessing)
in teamselect.lua:

Code: Select all

teammenu=librocket ("teamselect.html")
...
widget:DrawScreen()
  Librocket:Draw (teammenu, position, size, alpha,...)
end

widget:Librocket:GAME.ChangeTeam (teamID)    --this would be like a callin?
  blabla
end
Passing Lua variables to the html part would be possible too I guess, how would that look like?

But overall sounds like it would be a very usefull addition. If the documentation on how to make it work is good, I am sure it will get used.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Support for librocket

Post by abma »

after many thinking:

in short: +1 for librocket in the engine:

for new game devs, it would be much more interesting, to learn how to create a gui in librocket as in chilli. chilli is spring only, the knowledge of librocket can be reused in other games, too. there is/are also more documentation + examples. also it uses github: https://github.com/lloydw/libRocket

i'm unsure how much time it would take to integrate it into spring so that it is useable, thats a really big con.

i think its good, to see what happens with the assimp-support, so maybe lets wait a bit befor doing work here.

i don't know much about technical stuff: could/does librocket increase performance in comparison to chilli?
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Support for librocket

Post by Google_Frog »

I was sure I wrote more here. I still see it as a huge waste of effort and a potential source of instability.

The core reason for librocket seems to be "To make it easier for new game devs to make games". This is the statement I dispute.

Of course it is easier for someone who knows html but not lua to make a UI mockup. Unfortunately this does not translate into an advantage in ease over chilli when writing the UI. Most of the complexity in chilli widgets is in the interface between Spring and the state of the widget. Actually displaying the information and taking user input is very simple for the widget writer as the chilli framework handles it. I get the impression that librocket will interact with widgets which then interact with Spring so I do not see how this part of writing the UI is easier.

So from what I have heard, to get a working UI a game dev team will need someone to code the interaction with Spring in lua. Chilli is dead-easy for someone who knows lua enough to code the UI backend, for them defining the UI elements to display is chilli is basically no extra work.

Then the counter-argument follows that the designers has more control if there is a clear separation between what they do and do not understand. But I am not convinced that it is particularly important, the html-only competent person could easily make a design layout image for the lua coder (which I still have reason to believe must exist).

Anyway in the entire process of creating a game someone will have to know lua. So while librocket may be more applicable elsewhere, lua is necessary for a large part of the rest of the game. So there will be a lua coder somewhere. Also if you know enough lua to write a unit script you can edit window locations and sizes in a chilli widget.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Support for librocket

Post by hoijui »

jk himself agreed upon it being good to split the design from the logic (which is, btw, a defacto standard through the MVC pattern). he said he plans to do that with Chili too (i think he said something about some well known XML based format for UI design).
for me, that functionality in Chili would make librocket obsolete, but for others it may still not be a totally clear thing (eg. simplified HTML vs XML).
User avatar
Floris
Posts: 611
Joined: 04 Jan 2011, 20:00

Re: Support for librocket

Post by Floris »

Well a while ago I dared to make a widget... learning lua sounded okay, learning spring api was a challange. I thought, but it was actually a horror since there was no complete documentation and only finished it cause I had Niobium at mumble (which I didnt even know he was spring dev before).
Meeting with opengl code in lua was scary and just hearing about chilli doesnt ease my mind yet.

As a webdeveloper...
Hearing about HTML+CSS integration is an enlightment, and a thought I had when coding in lua. But... still... The greatest effort of writing a widget still lies in the horrible api documentation. HTML + CSS wouldn't change that a single bit.

A good point could be that the game/mod could adjust the apearance more easily I just guess by applying diffrent classes. But... still... the shape would quitte stay the same apart from coloring/texturing.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Support for librocket

Post by smoth »

Getting the layout in lua isn't the pain it is the code beneath. I could hammer my entire ui out in 2 evenings but getting all the relevant data and functionalities months man.
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Re: Support for librocket

Post by Das Bruce »

Has anyone seen a good tutorial on implementing librocket(not in spring)? I'm struggling to make heads or tails of their examples.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Support for librocket

Post by abma »

basic integration: http://librocket.com/wiki/documentation ... rinterface

+ http://librocket.com/wiki/documentation ?

imo their documentation is a good tutorial.
Post Reply

Return to “Feature Requests”