CrabUI
Loading...
Searching...
No Matches
GridLayoutTest.cs
1using System;
2using System.Reflection;
3using System.Runtime.CompilerServices;
4using System.Collections.Generic;
5using System.Collections.Immutable;
6using System.Linq;
7
8using Barotrauma;
9using HarmonyLib;
10using Microsoft.Xna.Framework;
11using Microsoft.Xna.Framework.Graphics;
12
13using CrabUI;
14
15namespace CrabUITest
16{
17 /// <summary>
18 /// Testing Layouts
19 /// </summary>
20 public partial class LayoutTest : FillMethods
21 {
22 public static void Grid(CUIComponent Host)
23 {
24 CUIFrame frame = new CUIFrame(0.2f, 0.2f, 0.6f, 0.6f);
25
26 CUIGrid grid = new CUIGrid()
27 {
28 Absolute = new CUINullRect(100, 100, 100, 100),
29
30 GridTemplateColumns = "75% 25%",
31 GridTemplateRows = "50% 50%",
32 };
33
34 grid.Append(new CUIComponent()
35 {
36 BackgroundColor = Color.Blue,
37 GridCell = new Point(0, 0),
38 });
39
40 frame.Append(grid);
41
42 Host.Append(frame);
43 }
44 }
45}
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.
Definition CUIFrame.cs:16
A Grid containing children in its cells.
Definition CUIGrid.cs:16
This class contains filling methods An Action<CUIComponent> that creates some GUI and attaches it t...
Rectangle with float?
Definition CUIRect.cs:104