public Button(string s, int x, int y, int w, int h, TCODColor fcol, TCODColor bcol, bool center, Action a) { this.Text = s; if (center) r = new Rect(x - w / 2, y, w, h); else r = new Rect(x, y, w, h); this.fcol = fcol; this.bcol = bcol; this.A = a; }
public bool Intersects(Rect r) { return ((((r.X < (this.X + this.W)) && (this.X < (r.X + r.W))) && (r.Y < (this.Y + this.H))) && (this.Y < (r.Y + r.H))); }