45 {
47 {
48 FitContent =
new CUIBool2(
true,
true),
50 Resizible = false,
51 OutlineColor = Color.SaddleBrown,
52 OutlineThickness = 4.0f,
53 BackgroundColor = new Color(0, 0, 0),
54 };
55
58 {
60 BackgroundColor = Color.SaddleBrown,
61 };
62
64 {
65 FitContent =
new CUIBool2(
true,
true),
66 Gap = 1.0f,
67 ConsumeDragAndDrop = true,
68 };
69
71 {
72 FitContent =
new CUIBool2(
true,
true),
73 Gap = 1.0f,
74 ConsumeDragAndDrop = true,
75 };
76
77 for (int i = 0; i < 30; i++)
78 {
79 Piano[
"layout"][
"white keys"].
Append(
new PianoKey(Color.White, $
"{i}"));
80 }
81
82 Piano[
"layout"][
"black keys"][
"offset"] =
new CUIComponent()
83 {
85 };
86
87 for (int i = 0; i < 29; i++)
88 {
89 if (
CUI.Random.Next(4) == 0)
90 {
92 {
94 });
95 }
96 else
97 {
98 Piano[
"layout"][
"black keys"].
Append(
new PianoKey(
new Color(64, 64, 64), $
"{i}"));
99 }
100 }
101
103 }
CUIAnchor is just a Vector2 This is a static class containing some helper methods.
Base class for all components.
virtual CUIComponent Append(CUIComponent child, string name=null, [CallerMemberName] string memberName="")
Adds children to the end of the list.
Draggable and resizable container for other components.
Resizing components to it's Height and placing them sequentially.
In fact a static class managing static things.
Resizing components to it's Width and placing them sequentially.