Ejemplo n.º 1
0
 public Background(Element parent, string textureName)
     : base(textureName)
 {
     Frame = 0;
     Padding = Vector2.Zero;
     parent.AddChild(this);
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 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
 }
Ejemplo n.º 4
0
 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);
 }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
 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;
 }
Ejemplo n.º 7
0
 public Border(Element parent)
     : this(parent, "defaulth3x3")
 {
 }
Ejemplo n.º 8
0
 public Button(Element parent)
     : this(parent, "default")
 {
 }
Ejemplo n.º 9
0
 public Text(Element parent)
     : this(parent, "default")
 {
 }
Ejemplo n.º 10
0
 public Background(Element parent)
     : this(parent, "default3x3")
 {
     Size = new Vector2(1, 3);
 }