예제 #1
0
 public void QueueRotate(ObjectInstance inst, Point oldLocation, Point newLocation, float oldRotation, float newRotation)
 {
     _objects.Add(new ObjectRecord() {
         Instance = inst,
         OldLocation = oldLocation,
         NewLocation = newLocation,
         OldRotation = oldRotation,
         NewRotation = newRotation,
     });
 }
예제 #2
0
 public void MoveTo(Point location)
 {
     Center = location;
 }
예제 #3
0
 public GripAnnot(Point center)
 {
     Center = center;
 }
예제 #4
0
 public GripAnnot(Point center, float size)
     : this(center)
 {
     Size = size;
 }
예제 #5
0
 public void MoveBy(int diffX, int diffY)
 {
     Center = new Point(Center.X + diffX, Center.Y + diffY);
 }
예제 #6
0
 public static Xna.Vector2 ToXnaVector2(this TF.Point point)
 {
     return(new Xna.Vector2(point.X, point.Y));
 }
예제 #7
0
 public static Xna.Point ToXnaPoint(this TF.Point point)
 {
     return(new Xna.Point(point.X, point.Y));
 }
예제 #8
0
 public void ActivateContextMenu(CommandMenu menu, Treefrog.Framework.Imaging.Point location)
 {
 }
예제 #9
0
        private void ShowPreviewMarker(PointerEventInfo info)
        {
            if (ActiveObjectClass == null)
                return;

            if (ActiveObjectClass != _activeClass) {
                HidePreviewMarker();
                _previewMarker = null;
                _activeClass = ActiveObjectClass;
            }

            if (!_previewMarkerVisible) {
                if (_previewMarker == null) {
                    _previewMarker = new ImageAnnot() {
                        Image = ActiveObjectClass.Image,
                        BlendColor = new Color(255, 255, 255, 128),
                    };
                }

                _annots.Add(_previewMarker);
                _previewMarkerVisible = true;
            }

            Point xlat = new Point((int)info.X - _activeClass.ImageBounds.Width / 2, (int)info.Y - _activeClass.ImageBounds.Height / 2);
            if (SnapManager != null)
                xlat = SnapManager.Translate(xlat, SnappingTarget);

            _previewMarker.Position = xlat;
        }
예제 #10
0
        private void StartDrawObjectSequence(PointerEventInfo info)
        {
            if (ActiveObjectClass == null)
                return;

            Point xlat = new Point((int)info.X - _activeClass.ImageBounds.Width / 2, (int)info.Y - _activeClass.ImageBounds.Height / 2);
            if (SnapManager != null)
                xlat = SnapManager.Translate(xlat, SnappingTarget);

            ObjectInstance inst = new ObjectInstance(ActiveObjectClass, xlat.X + ActiveObjectClass.Origin.X, xlat.Y + ActiveObjectClass.Origin.Y);
            History.Execute(new ObjectAddCommand(Layer, inst));
        }