Difference between revisions of "LGUI2:Package"

From Lavish Software Wiki
Jump to navigation Jump to search
(Created page with "LavishGUI 2 Packages provide a way to combine a LGUI2:Skin, LGUI2:Templates, LGUI2:Elements and other GUI parts into a single JSON object/...")
 
 
Line 12: Line 12:
 
! skin
 
! skin
 
| Either a String specifying the name of a [[LGUI2:Skin|Skin]] to use for the elements within, or an Object defining a new Skin (which will be used for the elements)
 
| Either a String specifying the name of a [[LGUI2:Skin|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 [[LGUI2:Elements|Elements]] to add'''
 +
|-
 +
! brushes
 +
| A JSON object containing a set of named [[LGUI2:Brushes|Brushes]] to add
 +
|-
 +
! fonts
 +
| A JSON object containing a set of named [[LGUI2:Fonts|Fonts]] to add
 +
|-
 +
! audioVoices
 +
| A JSON object containing a set of named [[LGUI2:Audio Voices|Audio Voices]] to add
 +
|-
 +
! audioStreams
 +
| A JSON object containing a set of named [[LGUI2:Audio Streams|Audio Streams]] to add
 +
|-
 +
! metaScripts
 +
| A JSON array containing a set of MetaScripts to prepare, and optionally auto-Start
 
|-
 
|-
 
! animationTypes
 
! animationTypes
| A JSON object containing a set of [[LGUI2:Animation Types|Animation Types]] to add
+
| A JSON array containing a set of [[LGUI2:Animation Types|Animation Types]] to add
 
|-
 
|-
 
! pixelShaders
 
! pixelShaders
Line 22: Line 40:
 
| A JSON object containing a set of [[LGUI2:Vertex Shaders|Vertex Shaders]] to add
 
| A JSON object containing a set of [[LGUI2:Vertex Shaders|Vertex Shaders]] to add
 
|-
 
|-
! elements
+
! includes
| A JSON array containing a set of [[LGUI2:Elements|Elements]] to add
+
| 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.
 
|}
 
|}
  

Latest revision as of 22:40, 15 December 2019

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