コード例 #1
0
        public UIButton(Graphics.Graphic t, Graphics.Font f, string s, Vector2 l)
        {
            this.texture  = t.Object;
            this.font     = f.Object;
            this.Text     = s;
            this.Bounds   = new Rectangle((int)l.X, (int)l.Y, (int)(this.font.MeasureString(Text).X * 1.1), (int)(this.font.MeasureString(Text).Y * 1.1));
            this.PenColor = Color.Black;



            this.Click += (o, i) => { this.OnClick(); }; //Sets the OnClick method to run when button is clicked
        }
コード例 #2
0
ファイル: UIPanel.cs プロジェクト: JWBentley/Siege-On-Windsor
 public UIPanel(Graphics.Graphic graphic, Rectangle rectangle) : base(rectangle)
 {
     this.panelImage = graphic;                  //Sets the image for the panel
     this.Children   = new List <UIComponent>(); //Creates a new list to store any children
 }