Exemplo n.º 1
0
 public ExitButton(Vec2 loc, Vec2 size, Image parent, Forms.Form parf)
 {
     if (size.X == 0 || size.Y == 0)
     {
         throw new Exception("No dimention of size can be zero!");
     }
     this.X = loc.X;
     this.Y = loc.Y;
     this.Size = size;
     this.iSize = new Vec2(size.X - 1, size.Y - 1);
     this.parent = parent;
     this.parForm = parf;
     this.bounds = new BoundingBox(this.X, this.X + Size.X, this.Y + Size.Y, this.Y);
     Click = new ObjectClick(this.ExitButtonClicked);
     MouseEnter = new ObjectClick(this.ExitButtonEnter);
     MouseLeave = new ObjectClick(this.ExitButtonLeave);
     MouseDown = new ObjectClick(this.ExitButtonMouseDown);
     MouseUp = new ObjectClick(this.ExitButtonMouseUp);
     evnts = new ObjectEvents(
         new ObjectClick(Click),
         new ObjectClick(MouseEnter),
         new ObjectClick(MouseLeave),
         new ObjectClick(MouseDown),
         new ObjectClick(MouseUp),
         new DrawMethod(Draw),
         bounds);
     i = new Image(size);
     this.DrawDefault();
 }
Exemplo n.º 2
0
 public ExitButton(Vec2 loc, Vec2 size, Image parent, Forms.Form parf)
 {
     if (size.X == 0 || size.Y == 0)
     {
         throw new Exception("No dimention of size can be zero!");
     }
     this.X       = loc.X;
     this.Y       = loc.Y;
     this.Size    = size;
     this.iSize   = new Vec2(size.X - 1, size.Y - 1);
     this.parent  = parent;
     this.parForm = parf;
     this.bounds  = new BoundingBox(this.X, this.X + Size.X, this.Y + Size.Y, this.Y);
     Click        = new ObjectClick(this.ExitButtonClicked);
     MouseEnter   = new ObjectClick(this.ExitButtonEnter);
     MouseLeave   = new ObjectClick(this.ExitButtonLeave);
     MouseDown    = new ObjectClick(this.ExitButtonMouseDown);
     MouseUp      = new ObjectClick(this.ExitButtonMouseUp);
     evnts        = new ObjectEvents(
         new ObjectClick(Click),
         new ObjectClick(MouseEnter),
         new ObjectClick(MouseLeave),
         new ObjectClick(MouseDown),
         new ObjectClick(MouseUp),
         new DrawMethod(Draw),
         bounds);
     i = new Image(size);
     this.DrawDefault();
 }