The panels structure is there to display "raw" text with some buttons to decide from. Panels are to be shown by script, e.g. when you click on an item.
You can use it for dialogues or just to show some "real" panel like the text on a road sign.
In the global PANELS-array, you can create as much panel entries as you want with the following parameters and values:
| Primary | Secondary | Default | mandatory | Description |
| INTERN | --- | --- | YES | The intern name of the panel, which is used by the interpeter and by scripts. This name has to be unique. |
| TEXT | --- | [empty array] | No | The text which is to be shown on the panel. It is in an array which will be linked together. The array is there that you can make line breaks in your GML file. |
| BUTTONS | --- | [empty array] | No | The buttons which the user can click into. A button has a TEXT and a SCRIPT[S] (or ONCLICK) array which executes the given jBash command/s. |
| BUTTON | --- | --- | No | ONE (other) button which the user can click into. This can be used as shortcut for just one button on the panel. A button has a TEXT and a SCRIPT[S] (and/or ONCLICK) array entry which executes the given jBash command/s. |
Every panel has its own BUTTONS array. A button is somewhat the same like an ITEM but without images. It displays a text button underneath the text of your panel.
Those are the values for a button:
| Primary | Secondary | Default | mandatory | Description |
| INTERN | --- | [empty array] | No | Intern name of the button. Used for jBash button command. |
| TEXT | --- | [empty array] | YES | Array with the texts to display on the panel. The array entries will be combined together. |
| ONCLICK | SCRIPT[S] | [empty array] | YES | The jBash-command-lines to execute when this button is clicked. |
| VISIBLE | --- | 1 | No | You can hide the button and show it later "ingame" per script. |
| SOUND | --- | --- | No | The intern name of the sound to play when this button is clicked. |
| DELAY | --- | 1.0 | No | How many fractions of the length of the sound to wait until the button executes its commands. |
Next: A GML-Example (Scripts will be explained after that.)
As of version 0.7.0, each GML structure has its own parser.
The parser for the panels is GMLParser_PANELS.
Add the parser to your project with:
GMLParser.addParser("PANELS",new GMLParser_PANELS());
Get the parser for getting values:
var panels = GMLParser.getParser("PANELS").panels;
As you see, you get the panels-array from the "PANELS" parser.
Each item in this array has the following entries:
| GML Name | Parser value/function (panels[x].Y) |
| INTERN | getIntern() |
| FOLDER | folder |
| TEXT | text |
| BUTTONS | buttons |
| ** | panelDiv |
The folder-variable contains the FULL path while the FOLDER-tag in GML contains a relative path.
** panelDiv contains the DOM data and will be created outside.
Every button in the buttons-array of an item has the following values.
| GML Name | Parser value/function (panels[x].Y) |
| INTERN | getIntern() |
| TEXT | buttonText |
| SCRIPTS / ONCLICK | buttonFunctions |
| VISIBLE | visible |
| SOUND | clickSound |
| DELAY | soundDelay |
The intern name of a button is used by the jBash command "button" and needs to be unique.
Next: A GML-Example (Scripts will be explained after that.)
Wiki: GIML_Structure
Wiki: GML_EXAMPLE
Wiki: GML_ITEMS
Wiki: Home