x3ro and me just finised our IRC session with some presence of Cervator and the result was a layout for the json style file, along with some discussion about implementing the parser for the json file in groovy.
json style file. an example of the available attributes and the layout.
Along with an short discussion about how to implement the correspondending JAVA class file it should be also quite possible to implement this without much changes of the current system.
json style file. an example of the available attributes and the layout.
Code:
{
"id": "main-menu",
"class": "UIDisplayWindow",
"children": [
{
"id" : "bg-image",
"class" : "UIImageOverlay",
"style" : {
"image" : "engine:bg.png",
}
},
{
"id" : "some-button",
"class" : "UIButton",
"style" : {
"onclick": "methodeName", // the function to call
"onhover" : "otherMethod",
"position-type" : "absolute", //absolute to whole screen / relative to parent widget
"position" : ["50%", "50%"], //pixel position by percentage of the current screen or just by pixels
"vertical-align": "center", //left / center / right - if this is used the position attribute should be added from this location
"horizontal-align" : "center", //top / center / bottom - same here
"image" : "engine:someimage.png", //image to load
"image-normal" : [0, 0, 100, 30], //x y width hight in someimage.png
"image-hover" : [0, 30, 100, 30],
"image-pressed" : [0, 60, 100, 30]
}
}
]
}