예제 #1
0
 public override void OnMouseDragEnd(MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left && isCreatingSelectionBox)
     {
         isCreatingSelectionBox = false;
         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);
         Point2I totalSize = editorControl.Level.Dimensions * editorControl.Level.RoomSize;
         for (int x = minCoord.X; x <= maxCoord.X && x < totalSize.X; x++)
         {
             for (int y = minCoord.Y; y <= maxCoord.Y && y < totalSize.Y; y++)
             {
                 ActivateTile(e.Button, new Point2I(x, y));
             }
         }
         LevelDisplayControl.ClearSelectionBox();
     }
 }
예제 #2
0
 public override void Deselect()
 {
     isCreatingSelectionBox = false;
     LevelDisplayControl.ClearSelectionBox();
 }