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); }
public Node(Node parent, Vector2 position, Vector2 size) { this.parent = parent; children = new List<Node>(); }
//public Node(Node parent) : this(parent, null, null) public Node(Node parent) : this(parent, Vector2.Zero, Vector2.Zero) { }
public void SetRoot(Node root) { this.root = root; }
public void AddChild(Node child) { children.Add(child); }