Menu

GML_PANELS

Benedict Jäggi

The PANELS structure

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:

PrimarySecondaryDefaultmandatoryDescription
INTERN------YESThe intern name of the panel, which is used by the interpeter and by scripts. This name has to be unique.
TEXT---[empty array]NoThe 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]NoThe 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------NoONE (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.

Panel-Buttons

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:

PrimarySecondaryDefaultmandatoryDescription
INTERN---[empty array]NoIntern name of the button. Used for jBash button command.
TEXT---[empty array]YESArray with the texts to display on the panel. The array entries will be combined together.
ONCLICKSCRIPT[S][empty array]YESThe jBash-command-lines to execute when this button is clicked.
VISIBLE---1NoYou can hide the button and show it later "ingame" per script.
SOUND------NoThe intern name of the sound to play when this button is clicked.
DELAY---1.0NoHow 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.)

Developer: Panels in code

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 NameParser value/function (panels[x].Y)
INTERNgetIntern()
FOLDERfolder
TEXTtext
BUTTONSbuttons
**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 NameParser value/function (panels[x].Y)
INTERNgetIntern()
TEXTbuttonText
SCRIPTS / ONCLICKbuttonFunctions
VISIBLEvisible
SOUNDclickSound
DELAYsoundDelay

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.)


Related

Wiki: GIML_Structure
Wiki: GML_EXAMPLE
Wiki: GML_ITEMS
Wiki: Home

MongoDB Logo MongoDB