Ejemplo n.º 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,
     });
 }
Ejemplo n.º 2
0
 public void MoveTo(Point location)
 {
     Center = location;
 }
Ejemplo n.º 3
0
 public GripAnnot(Point center)
 {
     Center = center;
 }
Ejemplo n.º 4
0
 public GripAnnot(Point center, float size)
     : this(center)
 {
     Size = size;
 }
Ejemplo n.º 5
0
 public void MoveBy(int diffX, int diffY)
 {
     Center = new Point(Center.X + diffX, Center.Y + diffY);
 }
Ejemplo n.º 6
0
 public static Xna.Vector2 ToXnaVector2(this TF.Point point)
 {
     return(new Xna.Vector2(point.X, point.Y));
 }
Ejemplo n.º 7
0
 public static Xna.Point ToXnaPoint(this TF.Point point)
 {
     return(new Xna.Point(point.X, point.Y));
 }
Ejemplo n.º 8
0
 public void ActivateContextMenu(CommandMenu menu, Treefrog.Framework.Imaging.Point location)
 {
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 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));
        }