Layouts

Layouts are collections of elements (positioned assets) that are displayed together.

Element

An element is a positioned asset on a layout.

Alignment

Whether the layer should align on the right, left, or center. The default alignment is right.

Alignment Types

Right

Left

Center

align: center

Offset

If you would like to move a element around by pixels you would set the offset. Offset works through pixel perfect adjustments.

Position

The position of an element depends on the ScreenSize of the player. It works by percents so 50 = 50%. If you set x = 50 and y = 50 the element would be in the center of the screen. The percentages are precise to a single decimal space.

Example Element

health:
  asset: 'vanilla-health'
  align: center
  position:
    x: 50.0
    y: 0
  offset:
    x: -49
    y: 54

Example Layout

default-layout:
  elements:
    health:
      asset: 'vanilla-health'
      align: left
      position:
        x: 50.0
        y: 0
      offset:
        x: -10
        y: 55
    food:
      type: 'asset'
      asset: 'vanilla-hunger'
      align: right
      position:
        x: 50.0
        y: 0.0
      offset:
        x: 10
        y: 55
    armor:
      asset: 'vanilla-armor'
      align: left
      position:
        x: 50.0
        y: 0.0
      offset:
        x: -10
        y: 65
    air:
      asset: 'vanilla-air'
      align: right
      position:
        x: 50.0
        y: 0.0
      offset:
        x: 10
        y: 65

Last updated