Definition Language

From GluonLogo

Jump to: navigation, search

The language which describes objects in Gluon is a very simple declarative language describing the order in which GameObjects, Components, Assets and Prefabs belong together, as well as their properties.

  • Any text between a # and the first following end-of-line must be ignored
  • Separation between objects is done by using curly braces {}
  • A keyword immediately following the starting curly brace (whitespace ignored) describes the type of object
  • The name of an object is written inside paranthesis after the object type
  • Properties are written in the following format, where propertyname is the name defined by the object type, propertytype is the data type (handled by the object's class, so can potentially be anything, but convention should be a type available as a QVariant), and propertyvalue is a string representation of the value of the property:
 [any whitespace]propertyname[any whitespace]propertytype(propertyvalue)[any whitespace]


Note: While whitespace is ignored (except for propertyvalue) the convention is to lay out the hierarchy and the objects in the following way:

{ objecttype(objectname)
    propertyname propertytype(propertyvalue)
    { objecttype(objectname)
        propertyname propertytype(propertyvalue)
    }
}

Contents

[edit] Object Types

Each object type may force special restrictions on the language, and this section describes what they are.

[edit] GameObject

A GameObject will allow only the following properties:

[edit] Required
  • description QString(value)
  • position QVector3d(x;y;z)
  • scale QVector3d(x;y;z)
  • rotationAxis QVector3d(x;y;z)
  • rotation float(value)
[edit] Optional
  • prefab QString(value)

where value is the name of the prefab

[edit] Component

Components cannot have children objects. The first property must be:

  • className QString(value)

where value is the name of the class representing that Component.

[edit] Prefab

[edit] Asset

Personal tools