public Transformable GetShape() { RoundedRectangleShape rectangle = new RoundedRectangleShape(new Vector2f(Position.Width, Position.Height), Radius); rectangle.Position = new Vector2f(Position.X, Position.Y); rectangle.FillColor = FillColor; rectangle.OutlineColor = OutlineColor; rectangle.OutlineThickness = OutlineThickness; return(rectangle); }
public override void Refresh() { base.Refresh(); BackgroundShape = new RoundedRectangleShape(Dimension, 20F, 3F, Color.Black, Color.Black, true); BackgroundShape.Position = Position; MainBox.Position = GetGlobalFromLocal(new Vector2f()); if (GetRoot() == null) return; if (Left < GetRoot().Left) Left = GetRoot().Left; if (Top < GetRoot().Top) Top = GetRoot().Top; if (BackgroundRight > GetRoot().BackgroundRight) BackgroundRight = GetRoot().BackgroundRight; if (BackgroundBottom > GetRoot().BackgroundBottom) BackgroundBottom = GetRoot().BackgroundBottom; }
public virtual bool RemoveItem(MenuItem item) { if (!MenuItems.Remove(item)) return false; if (Alignment == BlazeraLib.Alignment.Vertical) VMainBox.RemoveItem(item); else HMainBox.RemoveItem(item); BackgroundShape = new RoundedRectangleShape(Dimension, 20F, 3F, Color.Black, Color.Black, true); if (Alignment == BlazeraLib.Alignment.Vertical) VMainBox.Position = GetGlobalFromLocal(new Vector2f()); else HMainBox.Position = GetGlobalFromLocal(new Vector2f()); Refresh(); if (GetCurrentItem() != null) GetCurrentItem().CallOnSelection(); return true; }
public virtual void AddItem(MenuItem item, HAlignment alignment = DEFAULT_ITEM_HALIGNMENT) { MenuItems.Add(item); if (Alignment == BlazeraLib.Alignment.Vertical) { VMainBox.AddItem(item, 0, alignment); VMainBox.Refresh(); } else { HMainBox.AddItem(item, 0, VAlignment.Center); HMainBox.Refresh(); } BackgroundShape = new RoundedRectangleShape(Dimension, 20F, 3F, Color.Blue, Color.Green, true); if (Alignment == BlazeraLib.Alignment.Vertical) VMainBox.Position = GetGlobalFromLocal(new Vector2f()); else HMainBox.Position = GetGlobalFromLocal(new Vector2f()); Refresh(); GetCurrentItem().CallOnSelection(); }
void RefreshBackground() { BackgroundShape = new RoundedRectangleShape(Dimension, 20F, 3F, Color.Black, Color.Black, true); if (Alignment == BlazeraLib.Alignment.Vertical) ExtendedMainVBox.Position = GetGlobalFromLocal(new Vector2f()); else ExtendedMainHBox.Position = GetGlobalFromLocal(new Vector2f()); }