2using System.Reflection;
3using System.Runtime.CompilerServices;
4using System.Collections.Generic;
5using System.Collections.Immutable;
10using Microsoft.Xna.Framework;
11using Microsoft.Xna.Framework.Graphics;
27 public PianoKey(Color color,
string text =
"") : base(
"")
31 MasterColorOpaque = color;
48 FitContent =
new CUIBool2(
true,
true),
51 OutlineColor = Color.SaddleBrown,
52 OutlineThickness = 4.0f,
53 BackgroundColor =
new Color(0, 0, 0),
60 BackgroundColor = Color.SaddleBrown,
65 FitContent =
new CUIBool2(
true,
true),
67 ConsumeDragAndDrop =
true,
72 FitContent =
new CUIBool2(
true,
true),
74 ConsumeDragAndDrop =
true,
77 for (
int i = 0; i < 30; i++)
79 Piano[
"layout"][
"white keys"].
Append(
new PianoKey(Color.White, $
"{i}"));
82 Piano[
"layout"][
"black keys"][
"offset"] =
new CUIComponent()
87 for (
int i = 0; i < 29; i++)
89 if (
CUI.Random.Next(4) == 0)
98 Piano[
"layout"][
"black keys"].
Append(
new PianoKey(
new Color(64, 64, 64), $
"{i}"));
CUIAnchor is just a Vector2 This is a static class containing some helper methods.
Base class for all components.
CUINullRect Relative
Relative to parent size and position, [0..1].
virtual CUIComponent Append(CUIComponent child, string name=null, [CallerMemberName] string memberName="")
Adds children to the end of the list.
CUIBorder Border
Container for Color and Thickness Border is drawn inside the component and will eat space from cont...
Vector2 Anchor
this point of this component
CUINullRect Absolute
Absolute size and position in pixels.
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.
Vector2 TextAlign
A Vector2 ([0..1],[0..1])
Resizing components to it's Width and placing them sequentially.
This class contains filling methods An Action<CUIComponent> that creates some GUI and attaches it t...