예제 #1
0
        /// <summary>
        /// Play animation to hide page
        /// </summary>
        internal void AnimateHidePage(RotaryItemWrapper wrapper, bool isReverse = true, PageAnimationType type = PageAnimationType.Slide)
        {
            RotarySelectorItem rotaryItem = wrapper.RotaryItem;

            rotaryItem.Opacity = 1.0f;

            if (type == PageAnimationType.Slide)
            {
                Position pos     = wrapper.GetRotaryPosition(wrapper.CurrentIndex + 1);
                Position movePos = new Position(pos.X + (isReverse ? -70 : 70), pos.Y);

                animationCore.AnimateTo(rotaryItem, "Position", movePos, 0, 250, alphaGlideOut);
                animationCore.AnimateTo(rotaryItem, "Opacity", 0.0f, 0, 250, alphaGlideOut);
            }
            else
            {
                //Rotary hide animation
                animationCore.AnimatePath(rotaryItem, mAniUtil.GetRotaryPositionHidePath(wrapper, isReverse), Vector3.Zero, 0, 200, alphaSineOut33);
                animationCore.AnimateTo(rotaryItem, "Opacity", 0.0f, 0, 150, alphaSineOut33);
            }
        }
예제 #2
0
        /// <summary>
        /// Play animation to show page
        /// </summary>
        internal void AnimateShowPage(RotaryItemWrapper wrapper, bool isReverse = true, PageAnimationType type = PageAnimationType.Slide)
        {
            RotarySelectorItem rotaryItem = wrapper.RotaryItem;
            int wrapperIndex = wrapper.CurrentIndex;

            if (type == PageAnimationType.Slide)
            {
                int sTime = isReverse ? mAniUtil.GetStartTime(wrapperIndex) : 240 - mAniUtil.GetStartTime(wrapperIndex);

                Position pos = wrapper.GetRotaryPosition(wrapperIndex + 1);

                rotaryItem.Position = new Position(pos.X + (isReverse ? 70 : -70), pos.Y);;

                animationCore.AnimateTo(rotaryItem, "Position", pos, 167 + sTime, 84 + sTime + 334, alphaSineOut33);
                animationCore.AnimateTo(rotaryItem, "Opacity", 1.0f, 167 + sTime, 84 + sTime + 334, alphaSineOut33);
            }
            else
            {
                animationCore.AnimatePath(rotaryItem, mAniUtil.GetItemRotaryPath(wrapper, isReverse), Vector3.Zero, 200, 699, alphaGlideOut);
                animationCore.AnimateTo(rotaryItem, "Opacity", 1.0f, 200, 300, alphaGlideOut);
            }
        }