Skip to content

Instantly share code, notes, and snippets.

@x3ro
Created August 2, 2012 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save x3ro/3240690 to your computer and use it in GitHub Desktop.
Save x3ro/3240690 to your computer and use it in GitHub Desktop.
Terasology themeable UI brainstorming
{
"id": "main-menu",
"class": "UIWindow",
"children": [
{
"id" : "main-window",
"class" : "UIWindow",
"image" : "engine:bg.png",
},
{
"id" : "some-button",
"class" : "UIButton",
"parameters" : {
"onclick": "methodeName", # the function to call
"onhover" : "otherMethod",
"position-type" : "absolute", //absolute to whole screen / relative to parent widget
// x3ro: Not sure if we need this. Couldn't we just
// always be relative to the parent and put absolute
// stuff in the "root"?
"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]
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment