-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSimpleLayoutExample.cs
36 lines (34 loc) · 1.25 KB
/
SimpleLayoutExample.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using MagicUI.Core;
using MagicUI.Elements;
namespace MagicUIExamples
{
// demonstrates basic layout and element creation
public static class SimpleLayoutExample
{
public static void Setup(LayoutRoot layout)
{
new TextObject(layout)
{
TextAlignment = HorizontalAlignment.Center,
Text = "This is center-aligned text in the\ntop-left",
Padding = new(10)
};
new TextObject(layout)
{
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Bottom,
FontSize = 20,
Font = UI.TrajanBold,
Text = "This is a left-aligned text in the\nbottom center with big text"
};
new TextObject(layout)
{
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Top,
MaxWidth = 200,
MaxHeight = 80,
Text = "This text is really really really really really really really really really really really really really really reeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeaally long!"
};
}
}
}