コード例 #1
0
 protected override void OnMouseMove(MouseEventArgs e)
 {
     if (CanBeControlled)
     {
         if (MouseButtons.HasFlag(MouseButtons.Left))
         {
             int           x      = lastLocalMousePosition.X - LocalMousePosition.X;
             int           y      = lastLocalMousePosition.Y - LocalMousePosition.Y;
             Model.Vector2 offset = FieldRenderer.ScreenToOffset(new Point(x, y), Size);
             FieldRenderer.MoveCamera(offset);
         }
         lastLocalMousePosition = LocalMousePosition;
     }
 }