CrabUI
Loading...
Searching...
No Matches
Top Main.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 RandomTest : FillMethods
18 {
19 // cuitest RandomTest.TopMain
20 [HideFromAutoTestRunner]
21 public static void TopMain(CUIComponent Main)
22 {
23 Main["bottomFrame"] = new CUIFrame(0.6f, 0.2f, 0.3f, 0.4f)
24 {
25
26 };
27
28 Main["bottomFrame"]["button"] = new CUIButton("press me")
29 {
30 Anchor = CUIAnchor.Center,
31 };
32
33
34 CUIFrame frame = new CUIFrame(0, 0, 0.3f, 0.4f)
35 {
36 Anchor = CUIAnchor.Center,
37 Border = new CUIBorder(),
38 ConsumeMouseClicks = true,
39 };
40
41 frame["list"] = new CUIVerticalList()
42 {
43 Relative = new CUINullRect(0, 0, 1, 1),
44 };
45
46 frame["list"]["handle"] = new CUIComponent()
47 {
48 Absolute = new CUINullRect(h: 20),
49 };
50
51 frame["list"]["content"] = new CUIWater()
52 {
53 FillEmptySpace = new CUIBool2(false, true),
54 };
55
56 CUI.TopMain.Append(frame);
57 }
58
59
60 }
61}
CUIAnchor is just a Vector2 This is a static class containing some helper methods.
Definition CUIAnchor.cs:18
A button It's derived from CUITextBlock and has all its props.
Definition CUIButton.cs:19
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
In fact a static class managing static things.
Definition CUIErrors.cs:16
static CUIMainComponent TopMain
Orchestrates Drawing and updates, there could be only one CUI.TopMain is located above vanilla GUI.
Definition CUI.cs:89
Resizing components to it's Width and placing them sequentially.
Just an example of what CUICanvas can be used for.
Definition CUIWater.cs:16
Vector2 but with bools.
Definition CUIBool2.cs:17
Rectangle with float?
Definition CUIRect.cs:104