Ejemplo n.º 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;
        }
Ejemplo n.º 2
0
 public Frame(UI _parent, int _width, int _height)
     : base(_parent)
 {
     width = _width;
     height = _height;
     parent = _parent;
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 5
0
 public Dropdown(UI _parent, string _name, string _text, int _x, int _y)
     : this(_parent, _name, _text, _x, _y, Color.Black)
 {
 }
Ejemplo n.º 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)
 {
 }
Ejemplo n.º 7
0
 public UI(UI _parent)
 {
     parent = _parent;
 }
Ejemplo n.º 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);
        }