-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasicScreenExample.cs
More file actions
38 lines (31 loc) · 1 KB
/
Copy pathBasicScreenExample.cs
File metadata and controls
38 lines (31 loc) · 1 KB
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
37
38
using CodeUI;
namespace CodeUI.Examples
{
public sealed class BasicScreenExample : UIScreen
{
private UILabel m_CountLabel;
private int m_Count = 0;
protected override void Build()
{
CUI.Dim();
using (CUI.Plate(Anchor.Center, 640f, 480f, color: CUI.Theme.Panel))
{
CUI.Label("CUI EXAMPLE", 64f, anchor: Anchor.TopCenter,
width: 520f, height: 90f, margin: 48f);
m_CountLabel = CUI.Label("0", 72f, anchor: Anchor.Center,
width: 240f, height: 100f, offsetY: 20f);
CUI.Button("INCREMENT", 440f, 100f, Anchor.BottomCenter, margin: 52f,
onClick: Increment);
}
}
protected override void Preview()
{
m_CountLabel.Value = 3;
}
private void Increment()
{
m_Count++;
m_CountLabel.Value = m_Count;
}
}
}