public Background(Element parent, string textureName) : base(textureName) { Frame = 0; Padding = Vector2.Zero; parent.AddChild(this); }
public void AddChild(Element e) { if (!Children.Contains(e)) Children.Add(e); if (e.Parent != null) if (e.Parent.Children.Contains(e)) e.Parent.Children.Remove(e); e.Parent = this; }
public Border(Element parent, string textureName) : base(textureName) { Pattern = true; // If not pattern, scale Frame = 0; Padding = Vector2.Zero; parent.AddChild(this); // TODO: Integrate Padding }
public Text(Element parent, string textureName) : base(textureName) { Font = Graphics.DefaultFont; Content = "Text"; SelectedForeColor = Color.White; ForeColor = Color.LightGray; ShadowColor = Color.Black; OutlineColor = Color.Black; Outline = true; Shadow = false; OutlineOffset = 1; ShadowOffset = 1; TextAlignment = TextAlign.MiddleCenter; parent.AddChild(this); }
public Button(Element parent, string textureName) : base(textureName) { ExecutionScript = ""; Size = new Vector2(100, 30); DrawMe = false; Background = new Background(this); Border = new Border(this); Content = new Text(this); //Background.Overlay = new Color(40, 40, 40, 255); //Border.Overlay = new Color(80, 80, 80, 255); Content.Content = "Button"; parent.AddChild(this); }
public new virtual Element DeepClone() { Element s = new Element(); s.Position = Position; s.Size = Size; s.TextureName = TextureName; s.Scale = Scale; s.Rotation = Rotation; s.Origin = Origin; s.Overlay = Overlay; s.Effects = Effects; s.CurrentFrame = CurrentFrame; s.AnimationSetName = AnimationSetName; s.Parent = Parent; s.Children = new List<Element>(); for (int i = 0; i < Children.Count; i++) { s.Children.Add(Children[i].DeepClone()); } s.DrawMe = DrawMe; s.Selected = Selected; s.Disabled = Disabled; return s; }
public Border(Element parent) : this(parent, "defaulth3x3") { }
public Button(Element parent) : this(parent, "default") { }
public Text(Element parent) : this(parent, "default") { }
public Background(Element parent) : this(parent, "default3x3") { Size = new Vector2(1, 3); }