示例#1
0
        public Button(UI _parent, string _name, string _text, int _x, int _y, int _width, int _height, Color _color)
            : base(_parent)
        {
            parent = _parent;
            name = _name;
            text = _text;

            relX = _x;
            relY = _y;

            fontColor = _color;
            color = _color;

            backgroundColor = new Color(0f, 0f, 0f, 0.0f);
            backgroundHoverColor = new Color(0.1f, 0.1f, 0.1f, 1.0f);
            backgroundPressColor = new Color(0f, 0f, 0f, 0.0f);

            vertAlignment = VertAlignments.AlignMiddle;
            horizAlignment = HorizAlignments.AlignCenter;

            width = _width;
            height = _height;

            fontSize = FontSizes.Small;
        }
示例#2
0
 public Frame(UI _parent, int _width, int _height)
     : base(_parent)
 {
     width = _width;
     height = _height;
     parent = _parent;
 }
示例#3
0
 public Toggle(UI _parent, string _name, int _x, int _y, int _width, int _height)
     : base(_parent)
 {
     parent = _parent;
     name = _name;
     relX = _x;
     relY = _y;
     width = _width;
     height = _height;
     //fontSize = FontSizes.Medium;
     backgroundColor = new Color(1f, 1f, 1f, 0.2f);
     backgroundHoverColor = new Color(0f, 0f, 0f, 0.6f);
     backgroundPressColor = new Color(0f, 0f, 0f, 0.8f);
 }
示例#4
0
        public Label(UI _parent, string _name, string _text, int _x, int _y, Color _color)
            : base(_parent)
        {
            parent = _parent;
            name = _name;
            text = _text;

            relX = _x;
            relY = _y;

            fontColor = _color;
            color = _color;

            backgroundColor = new Color(0f, 0f, 0f, 0.0f);
            backgroundHoverColor = new Color(0f, 0f, 0f, 0.0f);
            backgroundPressColor = new Color(0f, 0f, 0f, 0.0f);

            vertAlignment = VertAlignments.AlignMiddle;
            horizAlignment = HorizAlignments.AlignCenter;
        }
示例#5
0
 public Dropdown(UI _parent, string _name, string _text, int _x, int _y)
     : this(_parent, _name, _text, _x, _y, Color.Black)
 {
 }
示例#6
0
 public Button(UI _parent, string _name, string _text, int _x, int _y, int _width, int _height)
     : this(_parent, _name, _text, _x, _y, _width, _height, Color.White)
 {
 }
示例#7
0
 public UI(UI _parent)
 {
     parent = _parent;
 }
示例#8
0
        public void AddChild(UI _child)
        {
            //TODO: Check if the child object's name is unique.

            if (_child.name == "")
                throw (new Exception("Name wasn't set on UI object"));

            ChildObjects.Add(_child);
        }