Пример #1
0
        public Button(Node parent, String text, SpriteFont font, int x, int y)
            : base(parent)
        {
            border = 2;
            color = Color.Red;

            this.text = text;
            this.font = font;
            this.x = x;
            this.y = y;

            position = new Vector2(x, y);

            Vector2 fontDimesions = font.MeasureString(text);
            textWidth = (int)fontDimesions.X;
            textHeight = (int)fontDimesions.Y;

            width = textWidth + border * 2;
            height = textHeight + border * 2;

            //dimensions = new Rectangle(x, y, width, height);
        }
Пример #2
0
 public Node(Node parent, Vector2 position, Vector2 size)
 {
     this.parent = parent;
     children = new List<Node>();
 }
Пример #3
0
 //public Node(Node parent) : this(parent, null, null)
 public Node(Node parent)
     : this(parent, Vector2.Zero, Vector2.Zero)
 {
 }
Пример #4
0
 public void SetRoot(Node root)
 {
     this.root = root;
 }
Пример #5
0
 public void AddChild(Node child)
 {
     children.Add(child);
 }