CrabUI
Loading...
Searching...
No Matches
Imprecise list positioning.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 // So, the problem scissor rect and not the positioning
20 public static void ImpreciseListPositioning(CUIComponent Main)
21 {
22 CUIFrame frame = new CUIFrame()
23 {
24 Anchor = CUIAnchor.Center,
25 Absolute = new CUINullRect(0, 0, 500, 500),
26 };
27
28 frame["l"] = new CUIVerticalList()
29 {
30 Absolute = new CUINullRect(0, 0, 40, 200),
31 Border = new CUIBorder(),
32 };
33
34 frame["l"]["h1"] = new CUIHorizontalList()
35 {
36 Absolute = new CUINullRect(0, 0, 40, 40),
37 Border = new CUIBorder(),
38 BackgroundColor = Color.Cyan * 0.5f,
39 CullChildren = false,
40 };
41
42 frame["l"]["h2"] = new CUIHorizontalList()
43 {
44 Absolute = new CUINullRect(0, 0, 40, 40),
45 Border = new CUIBorder(),
46 BackgroundColor = Color.Cyan * 0.5f,
47 CullChildren = false,
48 };
49
50 frame["l"]["h3"] = new CUIHorizontalList()
51 {
52 Absolute = new CUINullRect(0, 0, 40, 40),
53 Border = new CUIBorder(),
54 BackgroundColor = Color.Cyan * 0.5f,
55 //CullChildren = false,
56 };
57
58
59 frame["l"]["h1"]["c"] = new CUIComponent()
60 {
61 Absolute = new CUINullRect(0, 0, 40, 40),
62 BackgroundColor = Color.Blue * 0.5f,
63 Border = new CUIBorder(),
64 };
65
66 frame["l"]["h2"]["c"] = new CUIComponent()
67 {
68 Absolute = new CUINullRect(0, 0, 40, 40),
69 BackgroundColor = Color.Blue * 0.5f,
70 Border = new CUIBorder(),
71 };
72
73 frame["l"]["h3"]["c"] = new CUIComponent()
74 {
75 Absolute = new CUINullRect(0, 0, 40, 40),
76 BackgroundColor = Color.Blue * 0.5f,
77 Border = new CUIBorder(),
78 };
79
80
81
82 Main.Append(frame);
83 }
84
85
86
87
88
89 }
90}
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
Resizing components to it's Height and placing them sequentially.
Resizing components to it's Width and placing them sequentially.
Rectangle with float?
Definition CUIRect.cs:104