CrabUI
Loading...
Searching...
No Matches
EventConsumption.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 public static void EventConsumption(CUIComponent Main)
20 {
21 CUIFrame frame = new CUIFrame()
22 {
23 Relative = new CUINullRect(0, 0, 0.6f, 0.6f),
24 Anchor = CUIAnchor.Center,
25 };
26
27 frame["b1"] = new CUIButton("123")
28 {
29 Relative = new CUINullRect(0, 0, 0.6f, 0.1f),
30 Anchor = CUIAnchor.Center,
31 MasterColorOpaque = Color.Red,
32 };
33
34 frame["b2"] = new CUIButton("123")
35 {
36 Relative = new CUINullRect(0, 0, 0.1f, 0.6f),
37 Anchor = CUIAnchor.Center,
38 MasterColorOpaque = Color.Yellow,
39 };
40
41
42 Main.Append(frame);
43 }
44
45
46 }
47}
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
Rectangle with float?
Definition CUIRect.cs:104