예제 #1
0
파일: DEMenu.cs 프로젝트: zarac/tgspu
        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
파일: DEMenu.cs 프로젝트: zarac/tgspu
 public Node(Node parent, Vector2 position, Vector2 size)
 {
     this.parent = parent;
     children = new List<Node>();
 }
예제 #3
0
파일: DEMenu.cs 프로젝트: zarac/tgspu
 //public Node(Node parent) : this(parent, null, null)
 public Node(Node parent)
     : this(parent, Vector2.Zero, Vector2.Zero)
 {
 }
예제 #4
0
파일: DEMenu.cs 프로젝트: zarac/tgspu
 public void SetRoot(Node root)
 {
     this.root = root;
 }
예제 #5
0
파일: DEMenu.cs 프로젝트: zarac/tgspu
 public void AddChild(Node child)
 {
     children.Add(child);
 }