Ejemplo n.º 1
0
 public Label(Texture2D b, string text,
                   int x, int y, int width, int height, Control parent)
     : base(x, y, width, height, parent)
 {
     backgroundTexture = b;
     this.text = text;
 }
Ejemplo n.º 2
0
 public TextBox(Texture2D bt, string text,
                   int x, int y, int width, int height, Control parent)
     : base(x, y, width, height, parent)
 {
     backgroundTexture = bt;
     this.Text = text;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public Cursor(Texture2D texture, Control parent)
     : base(0, 0, 0, 0, parent)
 {
     Texture = texture;
     this.Parent = parent;
     FixX = 0;
     FixY = 0;
 }
Ejemplo n.º 4
0
 public Control(int left, int top, int width, int height, Control parent)
 {
     this.Left = left;
     this.Top = top;
     this.Width = width;
     this.Height = height;
     this.Parent = parent;
 }
Ejemplo n.º 5
0
 public CheckBox(Texture2D b, Texture2D c, string text, OnCheckChangeHandler onCheckChangeHandler,
                   int x, int y, int width, int height, Control parent, bool isChecked)
     : base(x, y, width, height, parent)
 {
     boxTexture = b;
     checkedTexture = c;
     boxX = (int)Game.GraphicsMgr.MeasureString(Font, text).X;
     this.text = text;
     this.isChecked = isChecked;
     OnCheckChange += new OnCheckChangeHandler(onCheckChangeHandler);
 }
Ejemplo n.º 6
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="barTexture"></param>
        /// <param name="buttonHeightPercent"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="width"></param>
        /// <param name="height"></param>
        /// <param name="parent"></param>
        public VScrollBar(Texture2D barTexture, float buttonHeightPercent, int x, int y, int width, int height, Control parent)
            : base(x, y, width, height, parent)
        {
            this.barTexture = barTexture;

            int btnHeight = (int)(height * buttonHeightPercent);
            btnYMin = 0;
            btnYMax = height - btnHeight;
            if (btnYMax <= btnYMin) btnYMax = btnYMin + 1;

            Texture2D nt, mt, pt;
            nt = resMgr.LoadTexture2D("EditorUI/VSCrollBar/VSBN");
            mt = resMgr.LoadTexture2D("EditorUI/VSCrollBar/VSBM");
            pt = resMgr.LoadTexture2D("EditorUI/VSCrollBar/VSBP");
            dragButton = new Button(nt, mt, pt, "", null, 0, btnYMin, width, btnHeight, this);
        }
Ejemplo n.º 7
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="backTexture"></param>
 /// <param name="_x"></param>
 /// <param name="_y"></param>
 /// <param name="width"></param>
 /// <param name="height"></param>
 /// <param name="parent"></param>
 public TextArea(Texture2D backTexture, int _x, int _y, int width, int height, Control parent)
     : base(_x, _y, width, height, parent)
 {
     Texture = backTexture;
     OnTextModeChange += onTextModeChangeHandler;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 添加普通的ui
 /// </summary>
 /// <param name="ui"></param>
 public void Add(Control ui)
 {
     ui.uiMgr = this;
     ControlList.Add(ui);
 }
Ejemplo n.º 9
0
 public void RemoveChild(Control ui)
 {
     int uiId = children.IndexOf(ui);
     if (uiId != -1)
         children.RemoveAt(uiId);
 }
Ejemplo n.º 10
0
 public void AddChild(Control ui)
 {
     children.Add(ui);
 }