CrabUI
Loading...
Searching...
No Matches
DrawFront.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
20
21
22 public static void DrawFront(CUIComponent Main)
23 {
24 Main["frame1"] = new CUIFrame()
25 {
26 Relative = new CUINullRect(0, 0, 0.4f, 0.4f),
27 BackgroundColor = Color.Black * 0.9f,
28 OutlineThickness = 4f,
29 OutlineColor = Color.White,
30 Border = new CUIBorder(new Color(0, 255, 255), 4),
31 Anchor = new Vector2(0.4f, 0.5f),
32 };
33
34 Main["frame1"].Append(new CUICloseButton()
35 {
36 Anchor = CUIAnchor.TopRight,
37 });
38
39 Main["frame2"] = new CUIFrame()
40 {
41 Relative = new CUINullRect(0, 0, 0.4f, 0.4f),
42 BackgroundColor = Color.Black * 0.9f,
43 OutlineThickness = 4f,
44 OutlineColor = Color.White,
45 Border = new CUIBorder(new Color(255, 0, 255), 4),
46 Anchor = new Vector2(0.6f, 0.5f),
47 };
48 }
49
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
Rectangle with float?
Definition CUIRect.cs:104