Bang Markup Language (BML) Syntax
BML is the native markup and stylesheet language for BangUI. It is designed for clarity, efficiency, and ease of parsing.
BML Syntax Rules
- Objects: Begin with
#and end with:- Example:
#btnExit:
- Example:
- Properties: Begin with
>and use a colon to separate name and value- Example:
>Text: "Exit"
- Example:
- Line Comments: Start with
// - Block Comments: Enclosed in
/* ... */ - Values: Can be quoted strings or constants (e.g., numbers, colors)
- Whitespace: Completely ignored in BML—spacing and indentation do not affect parsing
BML Example
// Line Comment
/* Block
Comment */
#btnExit: /* A button UI element */
>Text: "Exit" /* The Text property */
>TextColor: FF000000 /* The Text Color property */
#pnlMenu: /* A panel UI element */
>BackgroundColor: 303030FF /* Background Color */
>Width: 400 /* Width property */
>Height: auto /* Height property */
>hDock: Bottom /* Horizontal Docking */
>vDock: Fill /* Vertical Docking */
Mapping UI Properties to BML
Object markers (#) define UI elements and their scope. Every property defined for BangUI elements (global, 2D, 3D) can be specified in BML using the property marker (>), followed by the property name, colon, and value. Comments can be used anywhere for documentation or clarification.
BML in Practice
BML files are used to define UI layouts, styles, and element properties for BangUI applications. All element properties listed in this documentation are valid BML properties.