Skip to content

layouts

nixie123 edited this page Jan 23, 2025 · 111 revisions

layout is a grouping of text and images.

it can be used in a hud or popup and has three different layouts.

here's a rough idea of the structure.

(can put conditions on almost any element.)

Common Options

layout:
  y: -5
  x: 5
  images:
    1:
      name: example
      x: 10
      y: -10
      scale: 0.5
      layer: 1

scale

applies to images and text.

you can increase and decrease the size.

default : 1

ex. scale: 0.5

render-scale

can scale x-coord and y-coord independently.

render-scale:
  x: 0.5
  y: 0.5
  #static-scale: true

static-scale

Keep the same size regardless of the GUI scale.

When using this option, it is not recommended to set coordinates in the layout; instead, configure them through the coordinates in the HUD settings.

default: false

layer

priority to display when overlapping.

higher the number, the higher the priority.

default : 0

ex. layer: 1

x,y coordinates

coordinates of the layout can be moved in pixels.

you can move the entire layout or customize it individually.

Decimal numbers are not possible.

default : 0

ex.

x: 10

y: -10

align

this refers to how the text should be aligned.

types: left, center, right

ex. align: center

opacity

Adjust the opacity.

Range: 0–1

Default: 1

color-overrides

can override the colors in the layout.

test_layout:
  color-overrides:
    1:
      color: "#FF8080"
  heads:
    ...

images layout

image_layout:
  images:
    1:
      name: image_id
      scale: 0.5
      x: 5
      y: 10
    2:
    ...

load the images you set in the images folder.

stack

images
armor_stack_image:
  type: sequence
  files:
   - "armor/empty.png"
   - "armor/half.png"
   - "armor/full.png"

layouts
armor_stack_layout:
  images:
    1:
      name: armor_stack_image
      stack: armor@t / 2
      max-stack: 10
      space: 2
      y: 32
      x: -40

useful for implementing vanilla minecraft huds

this is the method used for hearts, armor, food, and air

one space per stack is filled.

texts layout

text_layout:
  texts:
    1:
      name: example_font
      space: 0
      number-format: "#,###.#"
      disable-number-format: false
      use-legacy-format: false
      pattern: "Lv. [mmocore_level]"
      #emoji-scale: 1
      #follow: parties_member_exclude_mine:1
      #cancel-if-follower-not-exists: false
      align: center
      x: 10
      y: -10
      scale: 0.5
      outline: true
      #deserialize-text: true
      #background: test
      #background-scale: 0.6

name

specifies the font to use.

font is named example_font if you follow the documentation.

ex. name: example_font

space

adjust the character spacing.

default: 1

number-format

automatically find and format numbers, even if they're mixed with text.

DecimalFormat, see the wiki for more information.

https://docs.oracle.com/javase/8/docs/api/java/text/DecimalFormat.html

default : config.yml - number-format: "#,###.#"

disable-number-format

does not use number-format.

if it true, '0.###' is used.

'false' is recommended if possible. -editor-

default: true

use-legacy-format

use legacy formatting.

ex. &aTest

if false, it is used as a text component base.

ex. <gold><b>Test

default: true

pattern

define the text to display.

PAPI can be used, and can be mixed with plain text.

ex. pattern: "Lv. [mmocore_level]"


can also embed images in your text. fonts documentation

pattern: "<image:example>"


can import variables from the skript.

The player uses the syntax 'hud player'.

ex. [skript_variable:%{test::%uuid of hud player%}%]


can use <space:n> to fine-tune the spacing between characters.

ex. "test<space:100>layout"


and you can add color and text formatting.

color type : <#hex>, <black>, <gold>, <gray>, <blue>, <green>, <aqua>, <red>, <yellow>, <white>

format type : bold <b>, obfuscated <obf>

emoji-scale

Adjust the scale of the glyph within the layout.

default: 1


layout scale option adjusts both text and glyphs across the layout,

while the font feature allows you to adjust the scale of each glyph individually.

emoji-scale option adjusts the size of all glyphs within the layout.

follow

If the player's name is returned as a PAPI, get the entered player's information for all PAPIs (pattern, conditions, etc.) used in that layout.

ex. follow: parties_member_exclude_mine:1

Certain PAPI can start at 0

mmocore_party_member_exclude_mine:0

cancel-if-follower-not-exists

An option to confirm whether to retrieve when the follow target is offline.

default: true

outline

whether or not to put a drop shadow on the text.

if text is on top of an image, you can't show a drop shadow.

however, if it has a higher layer value than the image, it will show.

ex. outline: true

deserialize-text

Caution

using this option may cause problems in normal use.

use it only when you need to intervene externally. ex.skript


this is an option to rework and colorize when color codes are injected from external elements, such as PAPI, for example.

default: false

background

text_layout:
  texts:
    1:
      ...
      background: example1
      background-scale: 0.6

see the backgrounds documentation for how to set this up first.

background-scale

adjust the scale of the background.

default: 1

Multi Lines

test_text:
  texts:
    1:
      ...
      pattern: |
       line1
       line2
       line3
       line4
       line5
      #pattern: Minecraft is a 3D sandbox adventure game developed by Mojang Studios where players can interact with a fully customizable three-dimensional world made of blocks and entities. Its diverse gameplay options allow players to choose the way they play, creating countless possibilities.
      line-align: center
      line: 5
      split-width: 300
      line-width: 20

can use '\n' inside the pattern to arbitrarily skip to the next line

line

how many multilines to display at most

default: 1

split-width

Pixel length to go to the next line

It is independent of the number of characters and considers the pixel length of each character.

line-align

this refers to how the multi line should be aligned.

types: left, center, right

line-width

spacing between lines and lines

heads layout

heads documentation

follow

If a player's name is returned to the PAPI, display that player's head.

ex. follow: parties_member_exclude_mine:1

Certain PAPI can start at 0

mmocore_party_member_exclude_mine:0

cancel-if-follower-not-exists

An option to confirm whether to retrieve when the follow target is offline.

default: true

fancy

the head becomes three-dimensional

ex. type: fancy

animations

animations can basically be organized by math formulas and use the exp4j library.

operations documentation

this example is an animation that moves up and down.

example_layout:
  images:
    1:
      name: image_id
  animations:
    type: play_once
    duration: 60
    x-equation: 0
    y-equation: 3cos(t/30 * pi)

type

types: loop, play_once

default: loop

when set to play_once, it will only run once.