LGUI2:Templates
Revision as of 04:41, 26 May 2018 by Lax (talk | contribs) (Created page with "A LavishGUI 2 Template is a JSON Object which provides values to use when not explicitly given (for example, default values). A LGUI2:Skin is then a collection of Templat...")
A LavishGUI 2 Template is a JSON Object which provides values to use when not explicitly given (for example, default values). A Skin is then a collection of Templates which are activated together.
Defining a Template
Templates are defined as JSON Objects, usually within a Skin. Each JSON Object in the Skin's "templates" Object will become a Template with the given name, stored within the Skin.
Example
{ "type": "skin", "name": "test skin", "templates": { "window.title": { "verticalAlignment": "center", "margin": [ 2, 0, 0, 0 ] }, "window.titleBar": { "backgroundBrush": { "color": [ 0, 0, 1.0 ] } }, "contextmenu": { "type": "contextmenu", "padding": [ 1, 1, 1, 1 ] }, "contextmenuitem": { "type": "contextmenuitem", "padding": [ 2, 2, 2, 2 ], "margin": [ 1, 1, 1, 1 ], "styles": { "gotMouseOver": { "backgroundBrush": { "color": [ 0.0, 0.0, 0.3 ] }, "font": { "bold": true }, "color": [ 1.0,1.0,0] }, "lostMouseOver": { "backgroundBrush": { "color": [ 0.0, 0.0, 0.0, 0.0 ] }, "font": { "bold": false }, "color": [ 1.0,1.0,1.0] } } } } }