2using System.Collections.Generic;
6using Microsoft.Xna.Framework;
7using Microsoft.Xna.Framework.Input;
8using Microsoft.Xna.Framework.Graphics;
17 public event Action OnOpen;
18 public event Action OnClose;
20 [CUISerializable]
public bool MoveToFrontOnClick {
get;
set; } =
true;
28 if (Host ==
null || Parent == Host)
return;
50 ConsumeMouseClicks =
true;
62 public CUIFrame(
float? x =
null,
float? y =
null,
float? w =
null,
float? h =
null) : this()
64 Relative =
new CUINullRect(x, y, w, h);
Base class for all components.
void MoveToFront()
Moves component to front in Parent.Children which makes it render after other childs.
bool Revealed
Visible + !IgnoreEvents.
CUINullRect Relative
Relative to parent size and position, [0..1].
virtual CUIComponent Append(CUIComponent child, string name=null, [CallerMemberName] string memberName="")
Adds children to the end of the list.
void AddCommand(string name, Action< object > action)
Manually adds command.
bool CullChildren
if child rect doesn't intersect with parent it won't be drawn and won't consume fps It also sets Hi...
Draggable and resizable container for other components.
void Open(CUIComponent Host=null)
This will reveal the frame and append it to CUI.Main.
void Close()
This will hide the frame and remove it from children of CUI.Main.
In fact a static class managing static things.
static CUIMainComponent Main
Orchestrates Drawing and updates, there could be only one CUI.Main is located under vanilla GUI.