MovingBlocks/Terasology — pull request #339 by miniME89 (2012-08-26 13:25:46+00:00)
Title: Gui

Extended GUI functionality:

- horizontal/vertical align
- absolute/relative positioning
- size and position can use pixel or percentage "unit"

Also added:
First version for working z-order -> click events won't get passed down by overlying display elements. (only works if the overlying display element added a mouse button or click listener)

New widget:
UIComposite which is an implementation of the UIDisplayContainer and therfore capable of holding child elements. Moreover an layout class can be added to the UIComposite to arrange child elements in a specific manner. This is similar to the SWT Composite widget. I implemented an layout similar to the Gridlayout in SWT. So positioning in a grid layout, as seen in the controls menu, is quite easy now. No more positioning of each child element and therefore less magic numbers, this will all be calculated and handled by the layout class. See UIMenuConfigControls for an example.

@x3ro: Could you take a look at the UIComposite and GridLayout class and tell me if it would be somehow easy to use with the upcoming GUI JSON parser? Because you would need to create an object of GridLayout in the parser and moreover the GridLayout itself has a lot of options which somehow needs to be set in the JSON file. The functionality could also be directly implemented in the UIComposite class for an easy use from the JSOn file, but than we wouldn't have the flexibility to add other Layout classes.