2using System.Collections.Generic;
4using System.Reflection;
5using System.Diagnostics;
6using System.Runtime.CompilerServices;
10using Microsoft.Xna.Framework;
11using Microsoft.Xna.Framework.Input;
12using Microsoft.Xna.Framework.Graphics;
19 public partial class CUIComponent
28 set =>
CUIProps.Padding.SetValue(value);
43 [CUISerializable]
public CUIBorder
Border {
get;
set; } =
new CUIBorder();
44 [CUISerializable]
public CUIBorder TopBorder {
get;
set; }
45 [CUISerializable]
public CUIBorder RigthBorder {
get;
set; }
46 [CUISerializable]
public CUIBorder BottomBorder {
get;
set; }
47 [CUISerializable]
public CUIBorder LeftBorder {
get;
set; }
51 public float OutlineThickness {
get;
set; } = 1f;
59 set =>
CUIProps.OutlineColor.SetValue(value);
68 get =>
CUIProps.BackgroundSprite.Value;
69 set =>
CUIProps.BackgroundSprite.SetValue(value);
79 get =>
CUIProps.IgnoreTransparent.Value;
80 set =>
CUIProps.IgnoreTransparent.SetValue(value);
91 get =>
CUIProps.BackgroundColor.Value;
92 set =>
CUIProps.BackgroundColor.SetValue(value);
95 private float transparency = 1.0f;
96 public float Transparency
101 transparency = value;
104 if (!child.IgnoreParentTransparency) child.Transparency = value;
116 set =>
CUIProps.Palette.SetValue(value);
118 public PaletteOrder DeepPalette
123 foreach (var child
in Children)
125 child.DeepPalette = value;
136 public Color ResizeHandleGrabbedColor {
get;
set; } = Color.Cyan;
Base class for all components.
CUISprite BorderSprite
Should be one texture, not sprite sheet Or there would be no way to wrap it Top side will always ...
PaletteOrder Palette
This palette will be used to resolve palette styles Primary, Secondary, Tertiary,...
SamplerState SamplerState
don't
CUIComponentProps CUIProps
Just a wrapper for CUIProps idk how to separate them better.
Vector2 Padding
Used for text, should be in CUITextBlock really.
CUIBorder Border
Container for Color and Thickness Border is drawn inside the component and will eat space from cont...
Color BackgroundColor
Color of BackgroundSprite, default is black If you're using custom sprite and don't see it make sur...
bool IgnoreTransparent
If true, mouse events on transparent pixels will be ignored Note: this will buffer texture data and...
Color OutlineColor
Outline is like a border, but on the outside of the component.
Color ResizeHandleColor
Had to expose resize handle props, because it's not a real component and can't really use styles.
CUISprite BackgroundSprite
Will be drawn in background with BackgroundColor Default is solid white 1x1 texture.
Wrapper Containing link to texture and drawing settings, like SourceRedt, DrawMode,...
static CUISprite Default
new Sprite that uses 1x1 default texture