Code Patterns
Copy-paste examples for common plugin tasks. Commands, events, ECS, GUI, and more.
All
225
Command
60
Damage
2
Ecs
27
Entity
5
Gui
75
Interaction
2
Inventory
4
Moderation
3
Permission
2
Player
9
Plugin
4
Storage
2
Teleport
3
Ui
22
Util
5
← Back to Patterns
java
gui
hytale-playsoundpage
Official Hytale UI: PlaySoundPage - Container layout with buttons with text elements
Example Code
$C = "../Common.ui";
$C.@Container {
Anchor: (Left: 50, Top: 170, Width: 360, Bottom: 120);
#Title {
Group {
LayoutMode: Left;
$C.@Title {
@Text = %server.customUI.playSoundPage.play;
}
}
$C.@HeaderSearch {}
}
#Content {
Group #SoundList {
LayoutMode: TopScrolling;
ScrollbarStyle: $C.@DefaultScrollbarStyle;
FlexWeight: 1;
}
Group {
LayoutMode: Top;
Anchor: (Top: 20);
Background: (TexturePath: "../Common/ContainerPanelPatch.png", Border: 4);
Padding: (Bottom:18);
Label #SoundName {
Padding: 8;
Style: (
FontSize: 18,
RenderUppercase: true,
RenderBold: true,
HorizontalAlignment: Center,
TextColor: #94969a
);
}
$C.@PanelSeparatorFancy {}
Group {
Anchor: (Top: 20);
LayoutMode: Left;
Padding: (Horizontal: 15);
Label {
Anchor: (Width: 80);
Text: "Volume (dB)";
Style: (...$C.@DefaultLabelStyle, VerticalAlignment: Center, Wrap: true);
}
Slider #VolumeSlider {
Anchor: (Left: 25, Width: 150, Height: 5);
Style: $C.@DefaultSliderStyle;
Min: -100;
Max: 10;
Step: 1;
Value: 0;
}
Label #VolumeValue {
Anchor: (Left: 10, Width: 50);
Text: "0";
Style: (HorizontalAlignment: Center, VerticalAlignment: Center);
}
}
Group {
Anchor: (Top: 20);
LayoutMode: Left;
Padding: (Horizontal: 15);
Label {
Anchor: (Width: 80);
Text: "Pitch (st)";
Style: (...$C.@DefaultLabelStyle, VerticalAlignment: Center, Wrap: true);
}
Slider #PitchSlider {
Anchor: (Left: 25, Width: 150, Height: 5);
Style: $C.@DefaultSliderStyle;
Min: -12;
Max: 12;
Step: 0.5;
Value: 0;
}
Label #PitchValue {
Anchor: (Left: 10, Width: 50);
Text: "0";
Style: (HorizontalAlignment: Center, VerticalAlignment: Center);
}
}
}
Group {
LayoutMode: Top;
Anchor: (Top: 15);
$C.@TextButton #Play {
@Sounds = (Activate: ());
Text: %server.customUI.playSoundPage.play;
}
}
}
}
$C.@BackButton {}