CrabUI
|
Base class for all components. More...
Public Member Functions | |
void | AddAnimation (string name, CUIAnimation animation) |
void | BlockChildrenAnimations () |
void | AttachTo (Item item, Action< Item, CUIComponent > callback=null) |
void | AddCommand (string name, Action< object > action) |
Manually adds command. | |
void | RemoveCommand (string name) |
void | DispatchUp (CUICommand command) |
Dispathes command up the component tree until someone consumes it. | |
void | DispatchDown (CUIData data) |
Dispathes command down the component tree until someone consumes it. | |
void | Execute (CUICommand command) |
Will execute action corresponding to this command. | |
virtual partial void | Draw (SpriteBatch spriteBatch) |
Here component should be drawn. | |
virtual partial void | DrawFront (SpriteBatch spriteBatch) |
Method for drawing something that should always be on top, e.g. resize handles. | |
virtual partial void | Draw (SpriteBatch spriteBatch) |
virtual partial void | DrawFront (SpriteBatch spriteBatch) |
CUIComponent (float? x=null, float? y=null, float? w=null, float? h=null) | |
void | Dispose () |
virtual void | CleanUp () |
override string | ToString () |
void | PrintTree (string offset="") |
void | Info (object msg, [CallerFilePath] string source="", [CallerLineNumber] int lineNumber=0) |
Prints component and then message. | |
CUIComponent | Remember (CUIComponent c, string name) |
CUIComponent | Remember (CUIComponent c) |
If it already has AKA. | |
CUIComponent | Forget (string name) |
CUIComponent | Forget (CUIComponent c) |
If it already has AKA. | |
virtual CUIComponent | Get (string name) |
Returns memorized component by name. | |
T | Get< T > (string name) |
void | CascadeRefresh () |
virtual bool | IsPointOnTransparentPixel (Vector2 point) |
virtual bool | ShouldInvoke (CUIInput e) |
void | InvokeOnLayoutUpdated () |
record | CompareResult (bool equal, string firstMismatch="") |
CUIComponent | Clone () |
void | SaveStateAs (string name) |
void | LoadState (string name) |
void | ForgetState (string name) |
void | ApplyState (CUIComponent state) |
virtual XElement | ToXML (CUIAttribute propAttribute=CUIAttribute.CUISerializable) |
virtual void | FromXML (XElement element, string baseFolder=null) |
string | Serialize (CUIAttribute propAttribute=CUIAttribute.CUISerializable) |
void | LoadSelfFromFile (string path, bool searchForSpritesInTheSameFolder=true, bool saveAfterLoad=false) |
void | LoadFromTheSameFile () |
void | SaveToTheSamePath () |
void | SaveToFile (string path, CUIAttribute propAttribute=CUIAttribute.CUISerializable) |
virtual void | Hydrate () |
Experimental method Here you can add data/ callbacks/ save stuff to variables after loading a xml skeletom. | |
virtual CUIComponent | Append (CUIComponent child, string name=null, [CallerMemberName] string memberName="") |
Adds children to the end of the list. | |
virtual CUIComponent | Prepend (CUIComponent child, string name=null, [CallerMemberName] string memberName="") |
Adds children to the begining of the list. | |
virtual CUIComponent | Insert (CUIComponent child, int index, string name=null, [CallerMemberName] string memberName="") |
void | RemoveSelf () |
CUIComponent | RemoveChild (CUIComponent child, [CallerMemberName] string memberName="") |
void | RemoveAllChildren ([CallerMemberName] string memberName="") |
void | MoveToFront () |
Moves component to front in Parent.Children which makes it render after other childs. | |
Static Public Member Functions | |
static void | RunRecursiveOn (CUIComponent component, Action< CUIComponent > action) |
designed to be versatile, in fact never used | |
static void | ForEach (Action< CUIComponent > action) |
static IEnumerable< Type > | GetClassHierarchy (Type type) |
static IEnumerable< Type > | GetReverseClassHierarchy (Type type) |
static bool | DeepCompareVerbose (CUIComponent a, CUIComponent b) |
static CompareResult | DeepCompare (CUIComponent a, CUIComponent b) |
static CUIComponent | Deserialize (string raw, string baseFolder=null) |
static CUIComponent | Deserialize (XElement e, string baseFolder=null) |
static CUIComponent | LoadFromFile (string path, bool searchForSpritesInTheSameFolder=true, bool saveAfterLoad=false) |
static T | LoadFromFile< T > (string path, bool searchForSpritesInTheSameFolder=true, bool saveAfterLoad=false) |
Public Attributes | |
Indexer< string, CUIAnimation > | Animations |
Dictionary< string, List< CUIComponent > > | DataTargets = new() |
Consumers of emmited data, updates on tree change. | |
bool | Disposed |
bool | ignoreDebug |
For debug frame itself. | |
CUIResizeHandle | LeftResizeHandle = new CUIResizeHandle(new Vector2(0, 1), new CUIBool2(false, false)) |
CUIResizeHandle | RightResizeHandle = new CUIResizeHandle(new Vector2(1, 1), new CUIBool2(true, false)) |
Static Public Attributes | |
static Dictionary< int, WeakReference< CUIComponent > > | ComponentsById = new() |
static WeakCatalog< Type, CUIComponent > | ComponentsByType = new() |
static GUIButton | dummyComponent |
This is used to trick vanilla GUI into believing that mouse is hovering some component and block clicks. | |
Protected Member Functions | |
void | ExtractProps (XElement element, string baseFolder=null) |
void | PackProps (XElement element, CUIAttribute propAttribute=CUIAttribute.CUISerializable) |
virtual void | PassPropsToChild (CUIComponent child) |
Pass props like ZIndex, Visible to a new child. | |
Protected Attributes | |
CUILayout | layout |
CUINullVector2 | forsedSize |
float | scale = 1f |
Color[] | TextureData |
Buffer for texture data, for IgnoreTransparent checks. | |
bool | disabled |
Properties | |
AttachedItemHandle | AttachedItemHandle [get, set] |
string | Command [get, set] |
This command will be dispatched up when some component specific event happens. | |
string | Consumes [get, set] |
Will consume data with this name. | |
bool | ReflectCommands [get, set] |
bool | RetranslateCommands [get, set] |
ObservableCollection< string > | Emits [get, set] |
Optimization to data flow If not empty component will search for consumers of the data and pass it directly to them instead of broadcasting it. | |
Dictionary< string, Action< object > > | Commands = new() [get, set] |
All commands. | |
static IEnumerable< CUIComponent > | AllComponents [get] |
bool | Debug [get, set] |
bool | IgnoreDebug [get, set] |
string | AKA [get, set] |
Parent can memorize it's children by their names, AKA. | |
Dictionary< string, CUIComponent > | NamedComponents = new() [get, set] |
All memorized components. | |
CUIComponent | this[string name] [get, set] |
You can access NamedComponents with this indexer. | |
bool | ConsumeMouseClicks [get, set] |
bool | ConsumeDragAndDrop [get, set] |
bool | ConsumeSwipe [get, set] |
bool | ConsumeMouseScroll [get, set] |
Action< double > | AddOnUpdate [set] |
Action< CUIInput > | AddOnMouseLeave [set] |
Action< CUIInput > | AddOnMouseEnter [set] |
Action< CUIInput > | AddOnMouseDown [set] |
Action< CUIInput > | AddOnMouseUp [set] |
Action< CUIInput > | AddOnMouseMove [set] |
Action< CUIInput > | AddOnMouseOn [set] |
Action< CUIInput > | AddOnMouseOff [set] |
Action< CUIInput > | AddOnClick [set] |
Action< CUIInput > | AddOnDClick [set] |
Action< CUIInput > | AddOnScroll [set] |
Action< float, float > | AddOnDrag [set] |
Action< float, float > | AddOnSwipe [set] |
Action< CUIInput > | AddOnKeyDown [set] |
Action< CUIInput > | AddOnKeyUp [set] |
Action< CUIInput > | AddOnTextInput [set] |
Action | AddOnFocus [set] |
Action | AddOnFocusLost [set] |
bool | Draggable [get, set] |
bool | Focusable [get, set] |
bool | Resizible [get, set] |
bool | ResizibleLeft [get, set] |
bool | ResizibleRight [get, set] |
CUIBool2 | ResizeDirection [get, set] |
bool | Swipeable [get, set] |
virtual CUILayout | Layout [get, set] |
Dictionary< string, CUIComponent > | States = new() [get, set] |
State is just a clone component with copies of all props. | |
string | SavePath [get, set] |
int | ID [get, set] |
Global ID, unique for component. | |
CUIMainComponent | MainComponent [get, set] |
Link to CUIMainComponent, passed to children. | |
bool | Focused [get, set] |
bool | BackgroundVisible [get, set] |
BackgroundColor != Color.Transparent. | |
bool | OutlineVisible [get, set] |
bool | MouseOver [get, set] |
bool | MousePressed [get, set] |
CUINullVector2 | ForcedMinSize [get, set] |
This is used by text to prevent resizing beyond that and works as AbsoluteMin. | |
float | Scale [get, set] |
This is set by ChildrenOffset when zooming, and iirc consumed by text to adjust text scale. | |
CUIRect | BorderBox [get, set] |
Calculated Prop, Real + BorderThickness. | |
CUIRect | OutlineBox [get, set] |
CUIRect | Real [get, set] |
Calculated prop, position on real screen in pixels Should be fully calculated after CUIMainComponent.Update. | |
CUIStyle | Style [get, set] |
Allows you to assing parsable string or link to CUIPalette to any prop It's indexable, so you can access it like this: component.Style["BackgroundColor"] = "cyan" if value starts with "CUIPalette." it will extract the value from palette e.g. component.Style["BackgroundColor"] = "CUIPalette.DarkBlue.Secondary.On" | |
CUIStyle | ResolvedStyle [get, set] |
List< CUIComponent > | Children = new() [get, set] |
CUIComponent? | Parent [get, set] |
IEnumerable< CUIComponent > | AddChildren [set] |
Allows you to add array of children. | |
CUIComponentProps | CUIProps = new() [get, set] |
Just a wrapper for CUIProps idk how to separate them better. | |
Vector2 | Padding [get, set] |
Used for text, should be in CUITextBlock really. | |
CUISprite | BorderSprite = CUISprite.Default [get, set] |
Should be one texture, not sprite sheet Or there would be no way to wrap it Top side will always point outwards. | |
CUIBorder | Border = new CUIBorder() [get, set] |
Container for Color and Thickness Border is drawn inside the component and will eat space from content If "by side" border prop != null then it'll take presidence. | |
CUIBorder | TopBorder [get, set] |
CUIBorder | RigthBorder [get, set] |
CUIBorder | BottomBorder [get, set] |
CUIBorder | LeftBorder [get, set] |
float | OutlineThickness = 1f [get, set] |
Color | OutlineColor [get, set] |
Outline is like a border, but on the outside of the component. | |
CUISprite | BackgroundSprite [get, set] |
Will be drawn in background with BackgroundColor Default is solid white 1x1 texture. | |
bool | IgnoreTransparent [get, set] |
If true, mouse events on transparent pixels will be ignored Note: this will buffer texture data and potentially consume a lot of memory so use wisely. | |
Color | BackgroundColor [get, set] |
Color of BackgroundSprite, default is black If you're using custom sprite and don't see it make sure this color is not black. | |
float | Transparency [get, set] |
PaletteOrder | Palette [get, set] |
This palette will be used to resolve palette styles Primary, Secondary, Tertiary, Quaternary. | |
PaletteOrder | DeepPalette [set] |
Color | ResizeHandleColor = Color.White [get, set] |
Had to expose resize handle props, because it's not a real component and can't really use styles. | |
Color | ResizeHandleGrabbedColor = Color.Cyan [get, set] |
SamplerState | SamplerState [get, set] |
don't | |
bool | HideChildrenOutsideFrame [get, set] |
Should children be cut off by scissor rect, this is just visual, it's not the same as culling. | |
bool | CullChildren [get, set] |
if child rect doesn't intersect with parent it won't be drawn and won't consume fps It also sets HideChildrenOutsideFrame | |
bool | UnCullable [get, set] |
It shouldn't be culled off even outside of parent bounds and even if parent demands so. | |
CUI3DOffset | ChildrenOffset [get, set] |
Will shift all children by this much, e.g. this is how scroll works It's also 3D. | |
Func< CUIRect, CUIBoundaries > | ChildrenBoundaries [get, set] |
Limits to children positions. | |
bool | Fixed [get, set] |
Should it ignore child offset? | |
Vector2 | Anchor [get, set] |
this point of this component | |
Vector2? | ParentAnchor [get, set] |
will be attached to this point of parent | |
CUIBool2 | Ghost [get, set] |
Ghost components don't affect layout. | |
int? | ZIndex [get, set] |
Components are drawn in order of their ZIndex Normally it's derived from component position in the tree, but this will override it. | |
bool | ResizeToSprite [get, set] |
If true component will set it's Absolute size to sprite texture size. | |
CUIBool2 | FillEmptySpace [get, set] |
Will be resized to fill empty space in list components. | |
CUIBool2 | FitContent [get, set] |
Will resize itself to fit components with absolute size, e.g. text. | |
CUINullRect | Absolute [get, set] |
Absolute size and position in pixels. | |
CUINullRect | AbsoluteMin [get, set] |
CUINullRect | AbsoluteMax [get, set] |
CUINullRect | Relative [get, set] |
Relative to parent size and position, [0..1]. | |
CUINullRect | RelativeMin [get, set] |
CUINullRect | RelativeMax [get, set] |
CUINullRect | CrossRelative [get, set] |
It's like Relative, but to the opposite dimension E.g. Real.Width = CrossRelative.Width * Parent.Real.Height Handy for creating square things. | |
string | GridTemplateRows [get, set] |
Used in Grid, space separated Row sizes, either in pixels (123) or in % (123%) | |
string | GridTemplateColumns [get, set] |
Used in Grid, space separated Columns sizes, either in pixels (123) or in % (123%) | |
Point? | GridStartCell [get, set] |
Component will be placed in this cell in the grid component. | |
Point? | GridEndCell [get, set] |
And resized to fit cells from GridStartCell to GridEndCell. | |
Point? | GridCell [get, set] |
Sets both GridStartCell and GridEndCell at once. | |
object | Data [get, set] |
Arbitrary data. | |
virtual bool | Disabled [get, set] |
Usually means - non interactable, e.g. unclickable gray button. | |
bool | ShouldPassPropsToChildren = true [get, set] |
Some props (like visible) are autopassed to all new childs see PassPropsToChild. | |
bool | IgnoreParentVisibility [get, set] |
Don't inherit parent Visibility. | |
bool | IgnoreParentEventIgnorance [get, set] |
Don't inherit parent IgnoreEvents. | |
bool | IgnoreParentZIndex [get, set] |
Don't inherit parent ZIndex. | |
bool | IgnoreParentTransparency [get, set] |
bool | Visible [get, set] |
Invisible components are not drawn, but still can be interacted with. | |
bool | IgnoreEvents [get, set] |
Won't react to mouse events. | |
bool | Revealed [get, set] |
Visible + !IgnoreEvents. | |
bool | Serializable = true [get, set] |
If false then this component and its children won't be serialized. | |
bool | SerializeChildren = true [get, set] |
Is this a serialization cutoff point Parent will serialize children down to this component and stop. | |
bool | MergeSerialization = false [get, set] |
If true it won't be deserialized, Instead its children will be detached and attached to the component with matching AKA on the parent. | |
bool | ReplaceSerialization = false [get, set] |
If true, deserialized component will replace existing component with the same AKA instead of creating a duplicate. | |
static bool | ForceSaveAllProps = false [get, set] |
![]() | |
![]() | |
![]() |
Events | |
Action< CUICommand > | OnAnyCommand |
this will be executed on any command | |
Action< CUIData > | OnAnyData |
Will be executed when receiving any data. | |
Action< Object > | OnConsume |
Happens when appropriate data is received. | |
Action | OnTreeChanged |
Action< double > | OnUpdate |
Action< CUIInput > | OnMouseLeave |
Action< CUIInput > | OnMouseEnter |
Action< CUIInput > | OnMouseDown |
Action< CUIInput > | OnMouseUp |
Action< CUIInput > | OnMouseMove |
Action< CUIInput > | OnMouseOn |
Action< CUIInput > | OnMouseOff |
Action< CUIInput > | OnClick |
Action< CUIInput > | OnDClick |
Action< CUIInput > | OnScroll |
Action< float, float > | OnDrag |
Action< float, float > | OnSwipe |
Action< CUIInput > | OnKeyDown |
Action< CUIInput > | OnKeyUp |
Action< CUIInput > | OnTextInput |
Action | OnFocus |
Action | OnFocusLost |
Action | OnLayoutUpdated |
Action | OnStyleApplied |
Use it to e.g. update component color. | |
Action< CUIComponent > | OnChildAdded |
Action< CUIComponent > | OnChildRemoved |
Base class for all components.
Definition at line 19 of file Serialization Props.cs.
CrabUI.CUIComponent.CUIComponent | ( | ) |
Definition at line 208 of file CUIComponent.cs.
CrabUI.CUIComponent.CUIComponent | ( | float? | x = null, |
float? | y = null, | ||
float? | w = null, | ||
float? | h = null ) |
Definition at line 232 of file CUIComponent.cs.
void CrabUI.CUIComponent.AddAnimation | ( | string | name, |
CUIAnimation | animation ) |
Definition at line 31 of file CUIComponent.Animations.cs.
void CrabUI.CUIComponent.AddCommand | ( | string | name, |
Action< object > | action ) |
Manually adds command.
name | |
action |
|
virtual |
Adds children to the end of the list.
child | |
name | AKA |
Definition at line 93 of file CUIComponent.Tree.cs.
void CrabUI.CUIComponent.ApplyState | ( | CUIComponent | state | ) |
Definition at line 85 of file CUIComponent.Serialization.cs.
void CrabUI.CUIComponent.BlockChildrenAnimations | ( | ) |
Definition at line 37 of file CUIComponent.Animations.cs.
void CrabUI.CUIComponent.CascadeRefresh | ( | ) |
Definition at line 29 of file CUIComponent.Events.cs.
|
virtual |
Definition at line 244 of file CUIComponent.cs.
CUIComponent CrabUI.CUIComponent.Clone | ( | ) |
Definition at line 70 of file CUIComponent.Serialization.cs.
record CrabUI.CUIComponent.CompareResult | ( | bool | equal, |
string | firstMismatch = "" ) |
Definition at line 22 of file CUIComponent.Serialization.cs.
|
static |
Definition at line 34 of file CUIComponent.Serialization.cs.
|
static |
Definition at line 27 of file CUIComponent.Serialization.cs.
|
static |
Definition at line 312 of file CUIComponent.Serialization.cs.
|
static |
Definition at line 317 of file CUIComponent.Serialization.cs.
void CrabUI.CUIComponent.DispatchDown | ( | CUIData | data | ) |
Dispathes command down the component tree until someone consumes it.
Definition at line 195 of file CUIComponent.Commands.cs.
void CrabUI.CUIComponent.DispatchUp | ( | CUICommand | command | ) |
Dispathes command up the component tree until someone consumes it.
command |
Definition at line 185 of file CUIComponent.Commands.cs.
void CrabUI.CUIComponent.Dispose | ( | ) |
Definition at line 238 of file CUIComponent.cs.
|
virtual |
Here component should be drawn.
spriteBatch |
Reimplemented in CrabUI.CUIButton, CrabUI.CUIMagnifyingGlass, CrabUI.CUIMainComponent, CrabUI.CUISlider, CrabUI.CUITextBlock, CrabUI.CUITextInput, and CrabUI.CUIToggleButton.
|
virtual |
Reimplemented in CrabUI.CUIButton, CrabUI.CUIMagnifyingGlass, CrabUI.CUIMainComponent, CrabUI.CUISlider, CrabUI.CUITextBlock, CrabUI.CUITextInput, and CrabUI.CUIToggleButton.
Definition at line 145 of file CUIComponent.cs.
|
virtual |
Method for drawing something that should always be on top, e.g. resize handles.
spriteBatch |
|
virtual |
Definition at line 155 of file CUIComponent.cs.
void CrabUI.CUIComponent.Execute | ( | CUICommand | command | ) |
Will execute action corresponding to this command.
commandName |
Definition at line 222 of file CUIComponent.Commands.cs.
|
protected |
Definition at line 230 of file CUIComponent.Serialization.cs.
|
static |
Definition at line 84 of file CUIComponent.cs.
CUIComponent CrabUI.CUIComponent.Forget | ( | CUIComponent | c | ) |
If it already has AKA.
Definition at line 109 of file CUIComponent.Debug.cs.
CUIComponent CrabUI.CUIComponent.Forget | ( | string | name | ) |
Definition at line 99 of file CUIComponent.Debug.cs.
|
virtual |
Definition at line 170 of file CUIComponent.Serialization.cs.
|
virtual |
Returns memorized component by name.
name |
Definition at line 135 of file CUIComponent.Debug.cs.
T CrabUI.CUIComponent.Get< T > | ( | string | name | ) |
T | : | CUIComponent |
|
static |
Definition at line 94 of file CUIComponent.cs.
|
virtual |
Experimental method
Here you can add data/ callbacks/ save stuff to variables
after loading a xml skeletom.
Definition at line 449 of file CUIComponent.Serialization.cs.
void CrabUI.CUIComponent.Info | ( | object | msg, |
[CallerFilePath] string | source = "", | ||
[CallerLineNumber] int | lineNumber = 0 ) |
Prints component and then message.
msg | |
source | |
lineNumber |
Definition at line 64 of file CUIComponent.Debug.cs.
|
virtual |
Definition at line 121 of file CUIComponent.Tree.cs.
|
virtual |
Definition at line 76 of file CUIComponent.Events.cs.
|
static |
Definition at line 359 of file CUIComponent.Serialization.cs.
|
static |
T | : | CUIComponent |
Definition at line 384 of file CUIComponent.Serialization.cs.
void CrabUI.CUIComponent.LoadFromTheSameFile | ( | ) |
Definition at line 409 of file CUIComponent.Serialization.cs.
void CrabUI.CUIComponent.LoadSelfFromFile | ( | string | path, |
bool | searchForSpritesInTheSameFolder = true, | ||
bool | saveAfterLoad = false ) |
Definition at line 338 of file CUIComponent.Serialization.cs.
void CrabUI.CUIComponent.MoveToFront | ( | ) |
Moves component to front in Parent.Children which makes it render after other childs.
Definition at line 201 of file CUIComponent.Tree.cs.
|
protected |
Definition at line 265 of file CUIComponent.Serialization.cs.
|
protectedvirtual |
Pass props like ZIndex, Visible to a new child.
child |
Definition at line 187 of file CUIComponent.Tree.cs.
|
virtual |
Adds children to the begining of the list.
child | |
name | AKA |
Definition at line 110 of file CUIComponent.Tree.cs.
void CrabUI.CUIComponent.PrintTree | ( | string | offset = "" | ) |
Definition at line 49 of file CUIComponent.Debug.cs.
CUIComponent CrabUI.CUIComponent.Remember | ( | CUIComponent | c | ) |
If it already has AKA.
Definition at line 93 of file CUIComponent.Debug.cs.
CUIComponent CrabUI.CUIComponent.Remember | ( | CUIComponent | c, |
string | name ) |
Definition at line 84 of file CUIComponent.Debug.cs.
void CrabUI.CUIComponent.RemoveAllChildren | ( | [CallerMemberName] string | memberName = "" | ) |
Definition at line 160 of file CUIComponent.Tree.cs.
CUIComponent CrabUI.CUIComponent.RemoveChild | ( | CUIComponent | child, |
[CallerMemberName] string | memberName = "" ) |
Definition at line 135 of file CUIComponent.Tree.cs.
|
static |
designed to be versatile, in fact never used
Definition at line 74 of file CUIComponent.cs.
void CrabUI.CUIComponent.SaveToFile | ( | string | path, |
CUIAttribute | propAttribute = CUIAttribute::CUISerializable ) |
Definition at line 429 of file CUIComponent.Serialization.cs.
void CrabUI.CUIComponent.SaveToTheSamePath | ( | ) |
Definition at line 419 of file CUIComponent.Serialization.cs.
string CrabUI.CUIComponent.Serialize | ( | CUIAttribute | propAttribute = CUIAttribute::CUISerializable | ) |
Definition at line 299 of file CUIComponent.Serialization.cs.
|
virtual |
Definition at line 106 of file CUIComponent.Events.cs.
|
virtual |
Definition at line 140 of file CUIComponent.Serialization.cs.
Indexer<string, CUIAnimation> CrabUI.CUIComponent.Animations |
Definition at line 30 of file CUIComponent.Animations.cs.
|
static |
Definition at line 52 of file CUIComponent.cs.
|
static |
Definition at line 61 of file CUIComponent.cs.
Dictionary<string, List<CUIComponent> > CrabUI.CUIComponent.DataTargets = new() |
Consumers of emmited data, updates on tree change.
Definition at line 138 of file CUIComponent.Commands.cs.
|
protected |
Definition at line 26 of file Other Props.cs.
bool CrabUI.CUIComponent.Disposed |
Definition at line 237 of file CUIComponent.cs.
|
static |
This is used to trick vanilla GUI into believing that mouse is hovering some component and block clicks.
Definition at line 67 of file CUIComponent.cs.
|
protected |
Definition at line 85 of file CUIComponent.State.cs.
bool CrabUI.CUIComponent.ignoreDebug |
For debug frame itself.
Definition at line 39 of file CUIComponent.Debug.cs.
|
protected |
Definition at line 23 of file CUIComponent.Layout.cs.
CUIResizeHandle CrabUI.CUIComponent.LeftResizeHandle = new CUIResizeHandle(new Vector2(0, 1), new CUIBool2(false, false)) |
Definition at line 153 of file CUIComponent.Events.cs.
CUIResizeHandle CrabUI.CUIComponent.RightResizeHandle = new CUIResizeHandle(new Vector2(1, 1), new CUIBool2(true, false)) |
Definition at line 154 of file CUIComponent.Events.cs.
|
protected |
Definition at line 103 of file CUIComponent.State.cs.
|
protected |
Buffer for texture data, for IgnoreTransparent checks.
Definition at line 119 of file CUIComponent.State.cs.
|
getset |
Absolute size and position in pixels.
Implements CrabUI.ISimpleProps.
Definition at line 123 of file Layout Props.cs.
|
getset |
Implements CrabUI.ISimpleProps.
Definition at line 135 of file Layout Props.cs.
|
getset |
Implements CrabUI.ISimpleProps.
Definition at line 129 of file Layout Props.cs.
|
set |
|
set |
Definition at line 64 of file CUIComponent.Events.cs.
|
set |
Definition at line 65 of file CUIComponent.Events.cs.
|
set |
Definition at line 67 of file CUIComponent.Events.cs.
|
set |
Definition at line 72 of file CUIComponent.Events.cs.
|
set |
Definition at line 73 of file CUIComponent.Events.cs.
|
set |
Definition at line 69 of file CUIComponent.Events.cs.
|
set |
Definition at line 70 of file CUIComponent.Events.cs.
|
set |
Definition at line 59 of file CUIComponent.Events.cs.
|
set |
Definition at line 58 of file CUIComponent.Events.cs.
|
set |
Definition at line 57 of file CUIComponent.Events.cs.
|
set |
Definition at line 61 of file CUIComponent.Events.cs.
|
set |
Definition at line 63 of file CUIComponent.Events.cs.
|
set |
Definition at line 62 of file CUIComponent.Events.cs.
|
set |
Definition at line 60 of file CUIComponent.Events.cs.
|
set |
Definition at line 66 of file CUIComponent.Events.cs.
|
set |
Definition at line 68 of file CUIComponent.Events.cs.
|
set |
Definition at line 71 of file CUIComponent.Events.cs.
|
set |
Definition at line 56 of file CUIComponent.Events.cs.
|
getset |
Parent can memorize it's children by their names, AKA.
Definition at line 78 of file CUIComponent.Debug.cs.
|
staticget |
Definition at line 53 of file CUIComponent.cs.
|
getset |
|
getset |
Definition at line 23 of file CUIComponent.Attached Item.cs.
|
getset |
Color of BackgroundSprite, default is black
If you're using custom sprite and don't see it make sure this color is not black.
Definition at line 89 of file Graphic Props.cs.
|
getset |
Will be drawn in background with BackgroundColor
Default is solid white 1x1 texture.
Definition at line 66 of file Graphic Props.cs.
|
getsetprotected |
BackgroundColor != Color.Transparent.
Definition at line 56 of file CUIComponent.State.cs.
|
getset |
Container for Color and Thickness
Border is drawn inside the component and will eat space from content
If "by side" border prop != null then it'll take presidence.
Definition at line 43 of file Graphic Props.cs.
|
getsetprotected |
Calculated Prop, Real + BorderThickness.
Definition at line 113 of file CUIComponent.State.cs.
|
getset |
Should be one texture, not sprite sheet
Or there would be no way to wrap it
Top side will always point outwards.
Definition at line 36 of file Graphic Props.cs.
|
getset |
Definition at line 46 of file Graphic Props.cs.
|
getset |
Definition at line 23 of file CUIComponent.Tree.cs.
|
getset |
|
getset |
Will shift all children by this much, e.g. this is how scroll works It's also 3D.
Definition at line 45 of file Layout Props.cs.
|
getset |
This command will be dispatched up when some component specific event happens.
Definition at line 49 of file CUIComponent.Commands.cs.
|
getset |
|
getset |
Definition at line 24 of file CUIComponent.Events.cs.
|
getset |
Definition at line 23 of file CUIComponent.Events.cs.
|
getset |
Definition at line 26 of file CUIComponent.Events.cs.
|
getset |
Will consume data with this name.
Definition at line 65 of file CUIComponent.Commands.cs.
|
getset |
Definition at line 25 of file CUIComponent.Events.cs.
|
getset |
It's like Relative, but to the opposite dimension
E.g. Real.Width = CrossRelative.Width * Parent.Real.Height
Handy for creating square things.
Implements CrabUI.ISimpleProps.
Definition at line 167 of file Layout Props.cs.
|
getset |
Just a wrapper for CUIProps idk how to separate them better.
Definition at line 27 of file CUIProps.cs.
|
getset |
if child rect doesn't intersect with parent it won't be drawn and won't consume fps
It also sets HideChildrenOutsideFrame
Definition at line 30 of file Layout Props.cs.
|
getset |
|
getset |
Definition at line 26 of file CUIComponent.Debug.cs.
|
set |
Definition at line 118 of file Graphic Props.cs.
|
getset |
Usually means - non interactable, e.g. unclickable gray button.
Definition at line 31 of file Other Props.cs.
|
getset |
Definition at line 140 of file CUIComponent.Events.cs.
|
getset |
Optimization to data flow
If not empty component will search for consumers of the data and pass it directly to them instead of broadcasting it.
Definition at line 106 of file CUIComponent.Commands.cs.
|
getset |
Will be resized to fill empty space in list components.
Implements CrabUI.IListProps.
Definition at line 105 of file Layout Props.cs.
|
getset |
Will resize itself to fit components with absolute size, e.g. text.
Implements CrabUI.ISimpleProps.
Definition at line 114 of file Layout Props.cs.
|
getset |
|
getset |
Definition at line 148 of file CUIComponent.Events.cs.
|
getset |
Definition at line 46 of file CUIComponent.State.cs.
|
getset |
This is used by text to prevent resizing beyond that and works as AbsoluteMin.
Definition at line 80 of file CUIComponent.State.cs.
|
staticgetset |
Implements CrabUI.ISerializationProps.
Definition at line 41 of file Serialization Props.cs.
|
getset |
Ghost components don't affect layout.
Implements CrabUI.ISimpleProps.
Definition at line 73 of file Layout Props.cs.
|
getset |
Sets both GridStartCell and GridEndCell at once.
Definition at line 192 of file Layout Props.cs.
|
getset |
And resized to fit cells from GridStartCell to GridEndCell.
Definition at line 188 of file Layout Props.cs.
|
getset |
Component will be placed in this cell in the grid component.
Definition at line 184 of file Layout Props.cs.
|
getset |
Used in Grid, space separated Columns sizes, either in pixels (123) or in % (123%)
Definition at line 180 of file Layout Props.cs.
|
getset |
Used in Grid, space separated Row sizes, either in pixels (123) or in % (123%)
Definition at line 176 of file Layout Props.cs.
|
getset |
Should children be cut off by scissor rect, this is just visual, it's not the same as culling.
Definition at line 24 of file Layout Props.cs.
|
getset |
Global ID, unique for component.
Definition at line 25 of file CUIComponent.State.cs.
|
getset |
Definition at line 39 of file CUIComponent.Debug.cs.
|
getset |
Won't react to mouse events.
Definition at line 68 of file Other Props.cs.
|
getset |
|
getset |
Definition at line 53 of file Other Props.cs.
|
getset |
|
getset |
|
getset |
If true, mouse events on transparent pixels will be ignored
Note: this will buffer texture data and potentially consume a lot of memory so use wisely.
Definition at line 77 of file Graphic Props.cs.
|
getset |
Definition at line 25 of file CUIComponent.Layout.cs.
|
getset |
Definition at line 47 of file Graphic Props.cs.
|
getset |
Link to CUIMainComponent, passed to children.
Definition at line 33 of file CUIComponent.State.cs.
|
getset |
If true it won't be deserialized,
Instead its children will be detached and attached to the component with matching AKA on the parent.
Implements CrabUI.ISerializationProps.
Definition at line 35 of file Serialization Props.cs.
|
getset |
Definition at line 72 of file CUIComponent.State.cs.
|
getset |
Definition at line 73 of file CUIComponent.State.cs.
|
getset |
All memorized components.
Definition at line 82 of file CUIComponent.Debug.cs.
|
getsetprotected |
Definition at line 114 of file CUIComponent.State.cs.
|
getset |
Outline is like a border, but on the outside of the component.
Definition at line 56 of file Graphic Props.cs.
|
getset |
Definition at line 51 of file Graphic Props.cs.
|
getsetprotected |
Definition at line 58 of file CUIComponent.State.cs.
|
getsetadd |
Used for text, should be in CUITextBlock really.
Definition at line 25 of file Graphic Props.cs.
|
getset |
This palette will be used to resolve palette styles
Primary, Secondary, Tertiary, Quaternary.
Definition at line 113 of file Graphic Props.cs.
|
getset |
Definition at line 25 of file CUIComponent.Tree.cs.
|
getset |
will be attached to this point of parent
Definition at line 67 of file Layout Props.cs.
|
getset |
Calculated prop, position on real screen in pixels Should be fully calculated after CUIMainComponent.Update.
Definition at line 125 of file CUIComponent.State.cs.
|
getset |
Definition at line 69 of file CUIComponent.Commands.cs.
|
getset |
Relative to parent size and position, [0..1].
Implements CrabUI.ISimpleProps.
Definition at line 144 of file Layout Props.cs.
|
getset |
Implements CrabUI.ISimpleProps.
Definition at line 156 of file Layout Props.cs.
|
getset |
Implements CrabUI.ISimpleProps.
Definition at line 150 of file Layout Props.cs.
|
getset |
If true, deserialized component will replace existing component with the same AKA instead of creating a duplicate.
Implements CrabUI.ISerializationProps.
Definition at line 40 of file Serialization Props.cs.
|
getset |
Definition at line 176 of file CUIComponent.Events.cs.
|
getset |
Had to expose resize handle props, because it's not a real component and can't really use styles.
Definition at line 134 of file Graphic Props.cs.
|
getset |
Definition at line 136 of file Graphic Props.cs.
|
getset |
If true component will set it's Absolute size to sprite texture size.
Definition at line 95 of file Layout Props.cs.
|
getset |
Definition at line 155 of file CUIComponent.Events.cs.
|
getset |
Definition at line 162 of file CUIComponent.Events.cs.
|
getset |
Definition at line 169 of file CUIComponent.Events.cs.
|
getset |
Definition at line 75 of file CUIComponent.Style.cs.
|
getset |
Definition at line 87 of file CUIComponent.Commands.cs.
|
getset |
Visible + !IgnoreEvents.
Definition at line 77 of file Other Props.cs.
|
getset |
Definition at line 45 of file Graphic Props.cs.
|
getset |
|
getset |
Definition at line 138 of file CUIComponent.Serialization.cs.
|
getset |
This is set by ChildrenOffset when zooming, and iirc consumed by text to adjust text scale.
Definition at line 98 of file CUIComponent.State.cs.
|
getset |
If false then this component and its children won't be serialized.
Implements CrabUI.ISerializationProps.
Definition at line 24 of file Serialization Props.cs.
|
getset |
Is this a serialization cutoff point
Parent will serialize children down to this component and stop.
Implements CrabUI.ISerializationProps.
Definition at line 29 of file Serialization Props.cs.
|
getset |
Some props (like visible) are autopassed to all new childs see PassPropsToChild.
Definition at line 40 of file Other Props.cs.
|
getset |
State is just a clone component with copies of all props.
Definition at line 68 of file CUIComponent.Serialization.cs.
|
getset |
Allows you to assing parsable string or link to CUIPalette to any prop
It's indexable, so you can access it like this: component.Style["BackgroundColor"] = "cyan"
if value starts with "CUIPalette." it will extract the value from palette
e.g. component.Style["BackgroundColor"] = "CUIPalette.DarkBlue.Secondary.On"
Definition at line 50 of file CUIComponent.Style.cs.
|
getset |
Definition at line 188 of file CUIComponent.Events.cs.
|
getset |
You can access NamedComponents with this indexer.
name |
Definition at line 120 of file CUIComponent.Debug.cs.
|
getset |
Definition at line 44 of file Graphic Props.cs.
|
getset |
Definition at line 96 of file Graphic Props.cs.
|
getset |
It shouldn't be culled off even outside of parent bounds and even if parent demands so.
Definition at line 39 of file Layout Props.cs.
|
getset |
Invisible components are not drawn, but still can be interacted with.
Definition at line 59 of file Other Props.cs.
|
getset |
Components are drawn in order of their ZIndex
Normally it's derived from component position in the tree, but this will override it.
Definition at line 84 of file Layout Props.cs.
Action<CUICommand> CrabUI.CUIComponent.OnAnyCommand |
this will be executed on any command
Definition at line 53 of file CUIComponent.Commands.cs.
Action<CUIData> CrabUI.CUIComponent.OnAnyData |
Will be executed when receiving any data.
Definition at line 57 of file CUIComponent.Commands.cs.
Action<CUIComponent> CrabUI.CUIComponent.OnChildAdded |
Definition at line 82 of file CUIComponent.Tree.cs.
Action<CUIComponent> CrabUI.CUIComponent.OnChildRemoved |
Definition at line 83 of file CUIComponent.Tree.cs.
Action<CUIInput> CrabUI.CUIComponent.OnClick |
Definition at line 44 of file CUIComponent.Events.cs.
Action<Object> CrabUI.CUIComponent.OnConsume |
Happens when appropriate data is received.
Definition at line 61 of file CUIComponent.Commands.cs.
Action<CUIInput> CrabUI.CUIComponent.OnDClick |
Definition at line 45 of file CUIComponent.Events.cs.
Action<float, float> CrabUI.CUIComponent.OnDrag |
Definition at line 47 of file CUIComponent.Events.cs.
Action CrabUI.CUIComponent.OnFocus |
Definition at line 52 of file CUIComponent.Events.cs.
Action CrabUI.CUIComponent.OnFocusLost |
Definition at line 53 of file CUIComponent.Events.cs.
Action<CUIInput> CrabUI.CUIComponent.OnKeyDown |
Definition at line 49 of file CUIComponent.Events.cs.
Action<CUIInput> CrabUI.CUIComponent.OnKeyUp |
Definition at line 50 of file CUIComponent.Events.cs.
Action CrabUI.CUIComponent.OnLayoutUpdated |
Definition at line 31 of file CUIComponent.Layout.cs.
Action<CUIInput> CrabUI.CUIComponent.OnMouseDown |
Definition at line 39 of file CUIComponent.Events.cs.
Action<CUIInput> CrabUI.CUIComponent.OnMouseEnter |
Definition at line 38 of file CUIComponent.Events.cs.
Action<CUIInput> CrabUI.CUIComponent.OnMouseLeave |
Definition at line 37 of file CUIComponent.Events.cs.
Action<CUIInput> CrabUI.CUIComponent.OnMouseMove |
Definition at line 41 of file CUIComponent.Events.cs.
Action<CUIInput> CrabUI.CUIComponent.OnMouseOff |
Definition at line 43 of file CUIComponent.Events.cs.
Action<CUIInput> CrabUI.CUIComponent.OnMouseOn |
Definition at line 42 of file CUIComponent.Events.cs.
Action<CUIInput> CrabUI.CUIComponent.OnMouseUp |
Definition at line 40 of file CUIComponent.Events.cs.
Action<CUIInput> CrabUI.CUIComponent.OnScroll |
Definition at line 46 of file CUIComponent.Events.cs.
Action CrabUI.CUIComponent.OnStyleApplied |
Use it to e.g. update component color.
Definition at line 30 of file CUIComponent.Style.cs.
Action<float, float> CrabUI.CUIComponent.OnSwipe |
Definition at line 48 of file CUIComponent.Events.cs.
Action<CUIInput> CrabUI.CUIComponent.OnTextInput |
Definition at line 51 of file CUIComponent.Events.cs.
Action CrabUI.CUIComponent.OnTreeChanged |
Definition at line 35 of file CUIComponent.Events.cs.
Action<double> CrabUI.CUIComponent.OnUpdate |
Definition at line 36 of file CUIComponent.Events.cs.