CrabUI
Loading...
Searching...
No Matches
Style.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
20 public static void Style(CUIComponent Main)
21 {
22 CUIFrame frame = new CUIFrame()
23 {
24 Absolute = new CUINullRect(200, 0, 200, 400),
25 Anchor = CUIAnchor.Center,
26 };
27
28 frame["content"] = new CUIComponent()
29 {
30 Relative = new CUINullRect(0.1f, 0.1f, 0.8f, 0.8f),
31 };
32
33 CUITextInput input = new CUITextInput()
34 {
35 AddOnTextChanged = (s) => CUITypeMetaData.Get(typeof(CUIComponent)).DefaultStyle["BackgroundColor"] = s,
36 };
37
38 frame["content"]["input"] = input;
39
40 Main.Append(frame);
41 }
42
43
44 }
45}
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 Get(string name)
Returns memorized component by name.
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