Exemple #1
0
 public override void OnMouseDragBegin(MouseEventArgs e)
 {
     // Draw a new selecion box.
     if (e.Button == MouseButtons.Left)
     {
         isCreatingSelectionBox = true;
         Point2I mousePos = new Point2I(e.X, e.Y);
         dragBeginTileCoord = LevelDisplayControl.SampleLevelTileCoordinates(mousePos);
         LevelDisplayControl.SetSelectionBox(dragBeginTileCoord, Point2I.One);
     }
 }
Exemple #2
0
 public override void OnMouseDragMove(MouseEventArgs e)
 {
     // Update selection box.
     if (e.Button == MouseButtons.Left && isCreatingSelectionBox)
     {
         Point2I mousePos  = new Point2I(e.X, e.Y);
         Point2I tileCoord = LevelDisplayControl.SampleLevelTileCoordinates(mousePos);
         Point2I minCoord  = GMath.Min(dragBeginTileCoord, tileCoord);
         Point2I maxCoord  = GMath.Max(dragBeginTileCoord, tileCoord);
         LevelDisplayControl.SetSelectionBox(minCoord, maxCoord - minCoord + Point2I.One);
     }
 }
Exemple #3
0
 public override void SelectAll()
 {
     isCreatingSelectionBox = false;
     LevelDisplayControl.SetSelectionBox(Point2I.Zero,
                                         EditorControl.Level.RoomSize * EditorControl.Level.Dimensions);
 }