LGUI2:Package

From Lavish Software Wiki
Jump to navigation Jump to search

LavishGUI 2 Packages provide a way to combine a Skin, Templates, Elements and other GUI parts into a single JSON object/file.

Defining a Package

A Package is defined by a JSON object enclosed by {}.

Package properties
templates A JSON object containing a set of Templates to add to the Default Skin
skin Either a String specifying the name of a Skin to use for the elements within, or an Object defining a new Skin (which will be used for the elements)
animationTypes A JSON object containing a set of Animation Types to add
pixelShaders A JSON object containing a set of Pixel Shaders to add
vertexShaders A JSON object containing a set of Vertex Shaders to add
elements A JSON array containing a set of Elements to add

Loading a Package

Packages can be loaded into LavishGUI 2 via the lgui2 LGUI2 object, via methods inherited from lgui2layer.

For a package stored as a file
LGUI2:LoadPackageFile[myPackageFile.json]
For direct JSON usage
variable jsonvalue MyJSON="{\"elements\":[\"Hello World!\"]}"
LGUI2:LoadPackage["${MyJSON.AsJSON.Escape}"]


LavishGUI 2 Topics