Skip to content
This repository was archived by the owner on Jan 6, 2026. It is now read-only.

YAML CSS Texture Declaration

Garkatron edited this page Jan 9, 2025 · 2 revisions

Current structure

"Texture": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "path": {
          "type": "string"
        },
        "width": {
          "type": "integer"
        },
        "height": {
          "type": "integer"
        },
        "mode": {
          "type": "string",
          "enum": ["STRETCH", "NINE_SLICE", "TILE"]
        },
        "border": {
          "type": "object",
          "properties": {
            "top": {
              "type": "integer"
            },
            "bottom": {
              "type": "integer"
            },
            "left": {
              "type": "integer"
            },
            "right": {
              "type": "integer"
            }
          }
        }
      }
    },

Current yaml syntax

# Unique identifier for this element. You can use any string.
- id: .$BUI.DEFAULT.SLOT.BGI
  # Path to the texture. This can be an external path or relative to the /assets directory.
  path: /assets/guilib/textures/gui/themes/default/Slot.png
  # Rendering mode for the texture.
  mode: STRETCH
  # Height of the texture in pixels.
  height: 18
  # Width of the texture in pixels.
  width: 18

# Configuration for a panel with a nine-slice texture.
- id: .$BUI.DEFAULT.PANEL.BGI
  # Path to the nine-slice texture.
  path: /assets/guilib/textures/gui/themes/default/nine_slice/ns_panel.png
  # Mode indicating the use of a nine-slice rendering technique.
  mode: NINE_SLICE
  # Height of the texture in pixels.
  height: 64
  # Width of the texture in pixels.
  width: 64
  # Borders define the padding for the nine-slice areas. These values indicate how many pixels
  # are taken from the respective edges of the texture for the border areas.
  border:
    # Number of pixels taken from the top edge.
    top: 6
    # Number of pixels taken from the bottom edge.
    bottom: 6
    # Number of pixels taken from the left edge.
    left: 6
    # Number of pixels taken from the right edge.
    right: 6

How to use

  - at: sometag
    backgroundImage: .$BUI.DEFAULT.SLIDER.BGI # Texture ID

Clone this wiki locally