public static UIComponent Border(this UIComponent component, int borderSize = 1, Color?borderColor = null) { component.DefaultAttributes.BorderSize = borderSize; component.DefaultAttributes.BorderColor = borderColor ?? Microsoft.Xna.Framework.Color.Black; return(component); }
public static UIComponent Sizing(this UIComponent component, Sizing sizing) { component.DefaultAttributes.Sizing = sizing; return(component); }
/// <summary> /// Adds a UIComponent to the tabindex if it can be tabbed /// </summary> /// <param name="component">The UIComponent that can be tabbed</param> public void AddTabIndexComponent(UIComponent component) { _tabIndex.Add(component); }
public static UIComponent Overflow(this UIComponent component, Overflow overflow) { component.DefaultAttributes.Overflow = overflow; return(component); }
public static UIComponent Image(this UIComponent component, string textureKey) { component.DefaultAttributes.TextureKey = textureKey; component.DefaultAttributes.Background = Microsoft.Xna.Framework.Color.White; return(component); }
public static UIComponent Width(this UIComponent component, int pixels) { return(component.AddConstraint(new UIWidthConstraint(pixels))); }
public static UIComponent Width(this UIComponent component, float percent) { return(component.AddConstraint(new UIWidthConstraint(percent))); }
public static UIComponent Bottom(this UIComponent component, int pixels) { return(component.AddConstraint(new UIPositionConstraint(bottom: pixels))); }
public static UIComponent Background(this UIComponent component, Color?color) { return(component.AddConstraint(new UIBackgroundConstraint(color ?? Microsoft.Xna.Framework.Color.Transparent))); }
public static UIComponent Color(this UIComponent component, Color?color) { return(component.AddConstraint(new UIColorConstraint(color ?? Microsoft.Xna.Framework.Color.Black))); }
public static UIComponent FontSize(this UIComponent component, float fontScale) { return(component.AddConstraint(new UIFontSizeConstraint(fontScale))); }
/** * Define the aspect ratio as a float. Ex: 16:9 ~= 1.78f */ public static UIComponent AspectRatio(this UIComponent component, float ratio) { return(component.AddConstraint(new UIAspectRatioConstraint(ratio))); }
public void AddUpdateIndexComponent(UIComponent component) { _updateIndex.Add(component); }
public static UIComponent Height(this UIComponent component, int pixels) { return(component.AddConstraint(new UIHeightConstraint(pixels))); }
public static UIComponent Position(this UIComponent component, Position position) { component.DefaultAttributes.Position = position; return(component); }
public static UIComponent Height(this UIComponent component, float percent) { return(component.AddConstraint(new UIHeightConstraint(percent))); }
public static UIComponent JustifyText(this UIComponent component, JustifyText justifyText) { component.DefaultAttributes.JustifyText = justifyText; return(component); }
public static UIComponent Left(this UIComponent component, int pixels) { return(component.AddConstraint(new UIPositionConstraint(left: pixels))); }
public static UIComponent VerticalAlignText(this UIComponent component, VerticalAlignText verticalAlignText) { component.DefaultAttributes.VerticalAlignText = verticalAlignText; return(component); }
public static UIComponent Center(this UIComponent component) { return(component.AddConstraint(new UICenterConstraint())); }
public static UIComponent FontScaleMode(this UIComponent component, FontScaleMode fontScaleMode) { component.DefaultAttributes.FontScaleMode = fontScaleMode; return(component); }
public static UIComponent Grow(this UIComponent component, int proportion) { component.DefaultAttributes.Grow = proportion; return(component); }
/// <summary> /// Adds a UIComponents that uses events into the Event Index /// </summary> /// <param name="component">The UIComponent that will emit events</param> public void AddEventComponent(UIComponent component) { _eventIndex.Add(component); }