CrabUI
Loading...
Searching...
No Matches
CrossRelative.cs
1using System;
2using System.Reflection;
3using System.Runtime.CompilerServices;
4using System.Collections.Generic;
5using System.Collections.Immutable;
6using System.Linq;
7using System.IO;
8
9using Barotrauma;
10using HarmonyLib;
11using Microsoft.Xna.Framework;
12using Microsoft.Xna.Framework.Graphics;
13
14using CrabUI;
15
16namespace CrabUITest
17{
18 public partial class PropTest : FillMethods
19 {
20
21 public static void CrossRelative(CUIComponent Main)
22 {
23 CUIFrame frame = new CUIFrame()
24 {
25 Anchor = CUIAnchor.Center,
26 Relative = new CUINullRect(w: 0.4f, h: 0.4f),
27 };
28
29 frame["box"] = new CUIComponent()
30 {
31 Anchor = CUIAnchor.Center,
32 Relative = new CUINullRect(w: 0.5f),
33 CrossRelative = new CUINullRect(h: 0.5f),
34 };
35
36 Main.Append(frame);
37 }
38
39
40 }
41}
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
Rectangle with float?
Definition CUIRect.cs:104