2using System.Reflection;
3using System.Runtime.CompilerServices;
4using System.Collections.Generic;
5using System.Collections.Immutable;
10using Microsoft.Xna.Framework;
11using Microsoft.Xna.Framework.Graphics;
17 public partial class PropTest : FillMethods
31 BackgroundColor = Color.Lime * 0.7f,
35 void AddContainer(
CUIComponent container,
bool x,
bool y)
38 if (!x && !y) yOffset = 0;
39 if (!x && y) yOffset = 1;
40 if (x && !y) yOffset = 2;
41 if (x && y) yOffset = 3;
43 container.FitContent =
new CUIBool2(
true,
true);
44 container.BackgroundColor = Color.Yellow;
45 container.Absolute =
new CUINullRect(offset, 100 + yOffset * 40);
46 container.AbsoluteMin =
new CUINullRect(w: 10, h: 10);
47 container.AKA = $
"{container.GetType().Name} [{x},{y}]";
48 container.
Append(Box(x, y));
52 void AddContainerType(Type type)
56 Absolute = new CUINullRect(offset, 80),
58 AddContainer((
CUIComponent)Activator.CreateInstance(type),
false,
false);
59 AddContainer((
CUIComponent)Activator.CreateInstance(type),
false,
true);
60 AddContainer((
CUIComponent)Activator.CreateInstance(type),
true,
false);
61 AddContainer((
CUIComponent)Activator.CreateInstance(type),
true,
true);
68 AddContainerType(typeof(
CUIGrid));
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.
A Grid containing children in its cells.
Resizing components to it's Height and placing them sequentially.
Resizing components to it's Width and placing them sequentially.