CrabUI
Loading...
Searching...
No Matches
CSharp
Client
CrabUI
Components
CUIPages.cs
1
using
System;
2
using
System.Collections.Generic;
3
using
System.Linq;
4
5
using
Barotrauma;
6
using
Microsoft.Xna.Framework;
7
using
Microsoft.Xna.Framework.Input;
8
using
Microsoft.Xna.Framework.Graphics;
9
10
namespace
CrabUI
11
{
12
/// <summary>
13
/// Container for other components
14
/// Can have only 1 child
15
/// Sets component as it's only child when you open it (as a page)
16
/// </summary>
17
public
class
CUIPages
:
CUIComponent
18
{
19
public
CUIComponent
OpenedPage;
20
21
public
bool
IsOpened(
CUIComponent
p) => OpenedPage == p;
22
23
/// <summary>
24
/// Adds page as its only child
25
/// </summary>
26
/// <param name="page"></param>
27
public
void
Open
(
CUIComponent
page)
28
{
29
RemoveAllChildren();
30
Append
(page);
31
page.Relative =
new
CUINullRect
(0, 0, 1, 1);
32
OpenedPage = page;
33
}
34
35
public
CUIPages
() : base()
36
{
37
BackgroundColor
= Color.Transparent;
38
Border.Color = Color.Transparent;
39
CullChildren
=
false
;
40
}
41
}
42
}
CrabUI.CUIComponent
Base class for all components.
Definition
Serialization Props.cs:20
CrabUI.CUIComponent.Append
virtual CUIComponent Append(CUIComponent child, string name=null, [CallerMemberName] string memberName="")
Adds children to the end of the list.
Definition
CUIComponent.Tree.cs:93
CrabUI.CUIComponent.BackgroundColor
Color BackgroundColor
Color of BackgroundSprite, default is black If you're using custom sprite and don't see it make sur...
Definition
Graphic Props.cs:90
CrabUI.CUIComponent.CullChildren
bool CullChildren
if child rect doesn't intersect with parent it won't be drawn and won't consume fps It also sets Hi...
Definition
Layout Props.cs:31
CrabUI.CUIPages
Container for other components Can have only 1 child Sets component as it's only child when you o...
Definition
CUIPages.cs:18
CrabUI.CUIPages.Open
void Open(CUIComponent page)
Adds page as its only child.
Definition
CUIPages.cs:27
CrabUI
Definition
CUIAnimation.cs:12
CrabUI.CUINullRect
Rectangle with float?
Definition
CUIRect.cs:104
Generated by
1.12.0