Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
MythicHUD MythicHUD
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 4
    • Issues 4
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • MythicCraft
  • MythicHUDMythicHUD
  • Wiki
  • Layouts

Layouts · Changes

Page history
Create Layouts authored Oct 03, 2024 by Brickgard's avatar Brickgard
Hide whitespace changes
Inline Side-by-side
Showing with 81 additions and 0 deletions
+81 -0
  • Layouts.md Layouts.md +81 -0
  • No files found.
Layouts.md 0 → 100644
View page @ afb8c713
Layouts are a collection of positioned assets to be displayed together. These elements are arranged based on the viewer's screen height and width, to scale to any game window or GUI scale size.
Layouts are displayed to the player on an invisible Boss Bar, and can be toggled with the `/hud layout` [Commands](Commands).
[Pop-ups](Pop-Ups) are configured the same as Layouts, however they are only shown to the player for a duration of time, rather than toggled on/off.
## Arrangement
### Alignment
Asset layers move in the direction of their alignment, from their start position:
| **align:** | `left` | `center` | `right` |
| ---------- | ------ | -------- | ------- |
### Position
The position of the element relative to the screen size of the player. This uses values from 0 to 100 to represent the location percentage horizontally and vertically the asset's origin should be placed.
```yaml
position:
x: 50
y: 50
```
#### Example Positions
| **X** | **Y** | **Description** |
| ----- | ----- | ----------------------- |
| 0 | 0 | Absolute Lower Left |
| 0 | 100 | Absolute Upper Left |
| 100 | 0 | Absolute Lower Right |
| 100 | 100 | Absolute Upper Right |
| 50 | 50 | Center a.k.a. Crosshair |
| 50 | 0 | Center Bottom |
| 50 | 100 | Center Top |
Positions are the starting origin for the offset pixel arrangement of an asset - these work together to provide consistent placement of assets in HUDs.
For example, a position of `x: 50` and `y: 0` originates at the bottom center of the screen, usually the player's hotbar - so using an offset of `y: 55` can ensure that a HUD is always bottom center, but pushed above the hotbar, regardless of screen or GUI scale size.
### Offset
Pixel positioning to further move the asset's placement by a fixed amount from its position.
```yaml
offset:
x: -5 # pixels left/right
y: 2 # pixels up/down
```
#### Example
```yaml
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
```
\ No newline at end of file
Clone repository
  • Advanced Version Support
  • Changelog
  • Commands
  • Compatibility
  • Components
    • Asset Layers
    • Assets
  • Conditions
  • Conditions
    • Effect
    • Gamemode
    • Logical Operator
    • Placeholder
    • Progress
  • Fonts
  • Getting Started
  • HUD Components
View All Pages