CrabUI
Loading...
Searching...
No Matches
RelativeDrag.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 EventTest : FillMethods
19 {
20
21 public static void RelativeDrag(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, h: 0.5f),
33 Draggable = true,
34 };
35
36 frame["box"].DragHandle.DragRelative = true;
37
38 Main.Append(frame);
39 }
40
41
42 }
43}
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
Testing events.
This class contains filling methods An Action<CUIComponent> that creates some GUI and attaches it t...
Rectangle with float?
Definition CUIRect.cs:104