Keller-Dev Docs · Java & Hytale

UI-System

Grundsätzlicher Aufbau einer UI-Datei

Eine .ui-Datei ist ein Hytalespezifisches Markup-System. Die Grundlegende Syntax ist hier beschrieben

// Basic declaration of an element
// with its Anchor property set to attach on all sides of its parent
// with 10 pixels of margin
Group { Anchor: (Left: 10, Top: 10, Right: 10, Bottom: 10); }
Group { Anchor: (Full: 10); } // More concise version
// Declaration of a Label with a name
// (can be used to access the element from game code)
Label #MyLabel {
  Style: LabelStyle(FontSize: 16); // or just Style: (FontSize: 16), type can be inferred.
  Text: "Hi! I am text.";
}
// Declaration of a Group containing 2 children
// You can use FlexWeight to distribute any left-over space after explicit widths/heights have been subtracted
Group {
  LayoutMode: Left;
  Label { Text: "Child 1"; FlexWeight: 2; }
  Label { Text: "Child 2"; FlexWeight: 1; }
}
https://hytalemodding.dev/de-DE/docs/official-documentation/custom-ui/markup
#ui #markup
Bearbeiten