LGUI2:Package

From Lavish Software Wiki
Revision as of 22:40, 15 December 2019 by Lax (talk | contribs)
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)
elements A JSON array containing a set of Elements to add
brushes A JSON object containing a set of named Brushes to add
fonts A JSON object containing a set of named Fonts to add
audioVoices A JSON object containing a set of named Audio Voices to add
audioStreams A JSON object containing a set of named Audio Streams to add
metaScripts A JSON array containing a set of MetaScripts to prepare, and optionally auto-Start
animationTypes A JSON array 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
includes A JSON array containing a set of LGUI2 Package filenames to load prior to loading any assets from this one
optionalIncludes A JSON array containing a set of optional LGUI2 Package filenames to load prior to loading any assets from this one. These will each be loaded if the file exists.

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