CrabUI
Loading...
Searching...
No Matches
List Gap.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 public partial class PropTest : FillMethods
18 {
19 public static void ListGap(CUIComponent Main)
20 {
21 CUIFrame frame = new CUIFrame()
22 {
23 Absolute = new CUINullRect(0, 0, 500, 500),
24 Anchor = CUIAnchor.Center,
25 };
26
27 CUIComponent Box() => new CUIComponent()
28 {
29 Absolute = new CUINullRect(w: 20, h: 20),
30 BackgroundColor = Color.Lime,
31 };
32
33 frame["list"] = new CUIHorizontalList()
34 {
35 Absolute = new CUINullRect(20, 20, null, 20),
36 FitContent = new CUIBool2(true, false),
37 Gap = 10,
38 BackgroundColor = Color.Blue,
39 };
40 frame["list"].Append(Box());
41 frame["list"].Append(Box());
42 frame["list"].Append(Box());
43 frame["list"].Append(Box());
44 frame["list"].Append(Box());
45 frame["list"].Append(Box());
46 frame["list"].Append(Box());
47 frame["list"].Append(Box());
48
49 Main.Append(frame);
50 }
51 }
52}
CUIAnchor is just a Vector2 This is a static class containing some helper methods.
Definition CUIAnchor.cs:18
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
Resizing components to it's Height and placing them sequentially.
Vector2 but with bools.
Definition CUIBool2.cs:17
Rectangle with float?
Definition CUIRect.cs:104