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); } }
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); } }
public override void SelectAll() { isCreatingSelectionBox = false; LevelDisplayControl.SetSelectionBox(Point2I.Zero, EditorControl.Level.RoomSize * EditorControl.Level.Dimensions); }