private void ShowMatrix(object sender, RoutedEventArgs e)
        {
            if (Globals.AnimationsNow.Count != 0)
            {
                return;
            }
            CurrentMatrix currentMatrix = new CurrentMatrix();

            WaitPanel.Visibility = Visibility.Visible;
            currentMatrix.ShowDialog();
        }
示例#2
0
        public object Clone()
        {
            Shape shape = new Shape();

            shape.alpha = alpha;
//            shape.AssetName = AssetName;
            shape.BaseMatrix              = (baseMatrix != null ? BaseMatrix.Clone() as int[][] : null);
            shape.BaseMatrixDimensions    = BaseMatrixDimensions;
            shape.BaseOrigin              = BaseOrigin;
            shape.BaseScreenPosition      = BaseScreenPosition;
            shape.CurrentMatrix           = (currentMatrix != null ? CurrentMatrix.Clone() as int[][] : null);
            shape.CurrentMatrixDimensions = CurrentMatrixDimensions;
            shape.currentRotationIdx      = currentRotationIdx;
            shape.CursorReturnOffset      = CursorReturnOffset;
            shape.destinationRotationIdx  = destinationRotationIdx;
            shape.IsDrawHighlighted       = IsDrawHighlighted;
            shape.horizontalFlipScale     = horizontalFlipScale;
            shape.isFlipMidway            = isFlipMidway;
            shape.isFlippedHorizontal     = isFlippedHorizontal;
            shape.isFlippedVertical       = isFlippedVertical;
            shape.isFlippingHorizontal    = isFlippingHorizontal;
            shape.isFlippingVertical      = isFlippingVertical;
            shape.isRotatingCW            = isRotatingCW;
            shape.isRotatingCCW           = isRotatingCCW;
            shape.IsSnapCueOnFlipFinish   = IsSnapCueOnFlipFinish;
            shape.IsSnapCueOnRotateFinish = IsSnapCueOnRotateFinish;
            shape.IsValid            = IsValid;
            shape.Key                = Key;
            shape.MusicCueName       = MusicCueName;
            shape.Name               = Name;
            shape.rotation           = rotation;
            shape.scale              = scale;
            shape.ShapeOrigin        = ShapeOrigin;
            shape.ScreenPosition     = ScreenPosition;
            shape.shapeResetDistance = shapeResetDistance;
            shape.State              = State;
            shape.texture            = Texture;
            shape.textureHL          = TextureHL;
            shape.TextureContentName = TextureContentName;
            shape.TileSize           = TileSize;
            shape.TimeIdle           = TimeIdle;
            shape.transition         = transition;
            shape.verticalFlipScale  = verticalFlipScale;

            return(shape);
        }
示例#3
0
        /// <summary>
        /// overrides the <see cref="CtrlEntity.OnMouseMove(HandledMouseEventArgs)"/>method.
        /// </summary>
        /// <param name="e"></param>
        /// <returns></returns>
        public override void OnMouseMove(HandledMouseEventArgs e)
        {
            base.OnMouseMove(e);
            if (Device == null)
            {
                return;
            }
            if (!Device.ForegroundDrawEnable)
            {
                return;
            }
            if (FirstMove)
            {
                AFirst    = A;
                BFirst    = B;
                FirstMove = false;
            }

            if (CurrentState == State.Create_SetSecondPoint)
            {
                B = Currentxy;
            }
            xy Factor = new xy(1, 1);

            if (CurrentCorner != Corner.none)
            {
                switch (CurrentCorner)
                {
                case Corner.none:
                    break;

                case Corner.C00:
                    _Trafo();


                    break;

                case Corner.C10:
                    _Trafo();
                    break;

                case Corner.C11:

                    _Trafo();
                    break;

                case Corner.C01:
                    _Trafo();
                    break;

                case Corner.Inside:
                { CurrentMatrix = Matrix3x3.Translation((Currentxy - FloatPoint)); }
                break;

                default:
                    break;
                }
                if (!CurrentMatrix.Equals(Matrix3x3.identity))
                {
                    A = CurrentMatrix * A;
                    B = CurrentMatrix * B;
                }
                if (Math.Abs(A.x - B.X) < 0.01)
                {
                }
                FloatPoint = Currentxy;
            }
            if (LiveTransform)
            {
                for (int i = 0; i < TransformItems.Count; i++)
                {
                    TransformItems[i].Transform(CurrentMatrix);
                }

                if (Device.ForegroundDrawEnable)
                {
                    if (LiveTransform)
                    {
                        Device.RefreshBackGround();
                        Device.CopyFromBackGround();
                    }
                }
            }
            TransFormAll = TransFormAll * CurrentMatrix;

            return;
        }