76 ScissorTestEnable =
true
124 if (!anchor.HasValue)
162 element.
Draw(spriteBatch);
169 element.Parent =
this;
170 Elements.
Add(element);
192 element.Parent =
null;
228 spriteBatch.GraphicsDevice.ScissorRectangle = scissorRectangle;
229 spriteBatch.GraphicsDevice.RasterizerState = rasterizerState;
236 if (this.OnUpdate !=
null)
253 int num = (int)((
float)Main.screenWidth *
Main.
UIScale);
286 parentDimensions.Height =
float.MaxValue;
315 result.X += parentDimensions.Width *
HAlign - result.Width *
HAlign;
316 result.Y += parentDimensions.Height *
VAlign - result.Height *
VAlign;
323 for (
int num = Elements.Count - 1; num >= 0; num--)
413 if (this.OnLeftMouseDown !=
null)
425 if (this.OnLeftMouseUp !=
null)
437 if (this.OnLeftClick !=
null)
449 if (this.OnLeftDoubleClick !=
null)
461 if (this.OnRightMouseDown !=
null)
473 if (this.OnRightMouseUp !=
null)
485 if (this.OnRightClick !=
null)
497 if (this.OnRightDoubleClick !=
null)
510 if (this.OnMouseOver !=
null)
523 if (this.OnMouseOut !=
null)
535 if (this.OnScrollWheel !=
null)
562 [Conditional(
"DEBUG")]
static readonly BlendState AlphaBlend
static readonly DepthStencilState None
unsafe Rectangle ScissorRectangle
RasterizerState RasterizerState
GraphicsDevice GraphicsDevice
static readonly SamplerState AnisotropicClamp
static float Clamp(float value, float min, float max)
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)
static Matrix UIScaleMatrix
static Microsoft.Xna.Framework.Color hslToRgb(Vector3 hslVector)
void Calculate(UIElement element)
bool IgnoresMouseInteraction
virtual void Update(GameTime gameTime)
CalculatedStyle GetOuterDimensions()
virtual void MouseOver(UIMouseEvent evt)
static readonly RasterizerState OverflowHiddenRasterizerState
UIElement GetElementAt(Vector2 point)
virtual int CompareTo(object obj)
virtual void ExecuteRecursively(UIElementAction action)
virtual void RightMouseDown(UIMouseEvent evt)
MouseEvent OnRightMouseUp
void DrawDebugHitbox(BasicDebugDrawer drawer, float colorIntensity=0f)
virtual void Draw(SpriteBatch spriteBatch)
MouseEvent OnRightDoubleClick
ScrollWheelEvent OnScrollWheel
virtual void OnDeactivate()
void Append(UIElement element)
virtual void RightDoubleClick(UIMouseEvent evt)
virtual void RightMouseUp(UIMouseEvent evt)
virtual void RightClick(UIMouseEvent evt)
CalculatedStyle GetInnerDimensions()
virtual void LeftClick(UIMouseEvent evt)
CalculatedStyle _innerDimensions
MouseEvent OnRightMouseDown
virtual void MouseOut(UIMouseEvent evt)
virtual void DrawSelf(SpriteBatch spriteBatch)
virtual void ScrollWheel(UIScrollWheelEvent evt)
delegate void UIElementAction(UIElement element)
delegate void ScrollWheelEvent(UIScrollWheelEvent evt, UIElement listeningElement)
virtual void LeftMouseDown(UIMouseEvent evt)
MouseEvent OnLeftMouseDown
MouseEvent OnLeftDoubleClick
IEnumerable< UIElement > Children
void SetSnapPoint(string name, int id, Vector2? anchor=null, Vector2? offset=null)
virtual void RecalculateChildren()
CalculatedStyle GetDimensionsBasedOnParentDimensions(CalculatedStyle parentDimensions)
virtual bool ContainsPoint(Vector2 point)
bool GetSnapPoint(out SnapPoint point)
delegate void ElementEvent(UIElement affectedElement)
virtual void Recalculate()
virtual void LeftMouseUp(UIMouseEvent evt)
delegate void MouseEvent(UIMouseEvent evt, UIElement listeningElement)
virtual Rectangle GetViewCullingArea()
virtual void DrawChildren(SpriteBatch spriteBatch)
CalculatedStyle _outerDimensions
CalculatedStyle GetDimensions()
void RemoveChild(UIElement child)
readonly List< UIElement > Elements
virtual void OnActivate()
void CopyStyle(UIElement element)
virtual void OnInitialize()
SamplerState OverrideSamplerState
virtual List< SnapPoint > GetSnapPoints()
void SetPadding(float pixels)
virtual void LeftDoubleClick(UIMouseEvent evt)
CalculatedStyle _dimensions
Rectangle GetClippingRectangle(SpriteBatch spriteBatch)
static UserInterface ActiveInstance
static Vector2 Transform(Vector2 position, Matrix matrix)
static StyleDimension Fill
static StyleDimension Empty
float GetValue(float containerSize)