Ejemplo n.º 1
0
 public override void OnMouseLeftUp(Point location)
 {
     if (moving)
     {
         moving = false;
         moveAction = null;
     }
 }
Ejemplo n.º 2
0
        public override void OnMouseMove(Point location)
        {
            if (moving)
            {
                Point move = new Point(location.X - mouseStart.X, location.Y - mouseStart.Y);
                if (!Util.Ctrl)
                    move = LayerEditor.Layer.Definition.SnapToGrid(move);

                move = new Point(move.X - moved.X, move.Y - moved.Y);
                if (move.X != 0 || move.Y != 0)
                {
                    if (moveAction != null)
                        moveAction.DoAgain(move);
                    else
                        LevelEditor.Perform(moveAction = new EntityMoveAction(LayerEditor.Layer, Ogmo.EntitySelectionWindow.Selected, move));
                    moved = new Point(move.X + moved.X, move.Y + moved.Y);
                    Ogmo.EntitySelectionWindow.RefreshContents();
                }
            }
        }
Ejemplo n.º 3
0
 public EntityMoveTool()
     : base("Move", "move.png")
 {
     moving = false;
     moveAction = null;
 }