Пример #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="direction">1 up, 0 down</param>
 private void UpDownAnimate(int direction)
 {
     position.Dispatcher.Invoke((Action)(() =>
     {
         _moveUpDown.Animate(position, direction);
     }));
 }
        protected async void AddContent_2()
        {
            try
            {
                List <ControlEntity> controlList = new List <ControlEntity>();
                var entry1 = new Entry()
                {
                    Style = EntryStyle,
                    Text  = "The opacity value has no effect unless IsVisible is true"
                };
                controlList.Add(new ControlEntity()
                {
                    ControlView = entry1
                });
                //await entry1.ScaleTo(1.2, (uint)1, eas);

                var entry2 = new Entry()
                {
                    Style = EntryStyle,
                    Text  = "The opacity value has no effect unless IsVisible is true"
                };
                controlList.Add(new ControlEntity()
                {
                    ControlView = entry2
                });
                //await entry2.ScaleTo(1.2, (uint)1, eas);

                var entry3 = new Entry()
                {
                    Style = EntryStyle,
                    Text  = "The opacity value has no effect unless IsVisible is true"
                };
                controlList.Add(new ControlEntity()
                {
                    ControlView = entry3
                });
                //await entry3.ScaleTo(1.2, (uint)1, eas);
                //stackLayoutContent1.IsVisible = stackLayoutContent2.IsVisible = stackLayoutContent3.IsVisible = false;

                stackLayoutContent1.Children.Add(entry1);
                stackLayoutContent2.Children.Add(entry2);
                stackLayoutContent3.Children.Add(entry3);
                await animation.Animate(controlList);

                //stackLayoutContent1.IsVisible = stackLayoutContent2.IsVisible = stackLayoutContent3.IsVisible = true;
                //await Task.Delay(100);
                //await entry1.ScaleTo(1, speed, easBack);
                //await Task.Delay(delay);
                //await entry2.ScaleTo(1, speed, easBack);
                //await Task.Delay(delay);
                //await entry3.ScaleTo(1, speed, easBack);
            }
            catch (Exception ex)
            {
                var msg = ex;
            }
        }
Пример #3
0
 public void Animate()
 {
     if (m_animation != null)
     {
         float cameraFOV;
         for (int i = 0; i < m_model.GroupCount; ++i)
         {
             var partName = m_model.GetGroupName(i);
             m_animation.Animate(partName, m_animTime, out m_visibility[i], out m_groupTransforms[i], out m_uvOffset[i], out m_uvScale[i], out m_colour[i], out cameraFOV);
             m_fullTransforms[i] = m_groupTransforms[i] * m_baseTransform;
             m_fullColour[i]     = m_colour[i];
             m_fullColour[i].W  *= m_alpha;
         }
     }
 }
Пример #4
0
        private async void AddComponent()
        {
            StartAnimation();
            buttonBack = new Button()
            {
                Text  = "Go back",
                Style = (Style)App.CurrentApp.Resources["buttonStyle"]
            };
            buttonBack.Clicked += (sender, e) =>
            {
                App.CurrentApp.MainPage = new Animation_TestMainPage();
            };
            await animation.Add(buttonBack);

            stackLayoutContent.Children.Add(buttonBack);
            await animation.Animate();
        }
Пример #5
0
        private Vector3 SampleLightAnim(string partName, Vector3 inColour, Vector3 inDir, out Vector3 o_outDir)
        {
            bool    visible;
            Matrix4 transform;
            Vector2 uvOffset;
            Vector2 uvScale;
            Vector4 colour;
            float   cameraFOV;

            m_animation.Animate(partName, m_animTime, out visible, out transform, out uvOffset, out uvScale, out colour, out cameraFOV);
            MathUtils.FastInvert(ref transform);
            o_outDir = Vector3.TransformNormalInverse(inDir, transform);
            return(visible ? new Vector3(
                       inColour.X * colour.X * colour.W,
                       inColour.Y * colour.Y * colour.W,
                       inColour.Z * colour.Z * colour.W
                       ) : Vector3.Zero);
        }
Пример #6
0
        public void Populate(Camera camera)
        {
            Matrix4 transform;
            float   fov;

            if (m_animation != null)
            {
                bool    visible;
                Vector2 uvOffset;
                Vector2 uvScale;
                Vector4 colour;
                m_animation.Animate("camera", m_timeMachine.Time - m_animStartTime, out visible, out transform, out uvOffset, out uvScale, out colour, out fov);
                MathUtils.FastInvert(ref transform);
            }
            else
            {
                transform = Matrix4.Identity;
                fov       = Game.DEFAULT_FOV;
            }
            camera.Transform = transform;
            camera.FOV       = fov;
        }
        protected async void AddComponent()
        {
            buttonBack = new Button()
            {
                Text  = "Go back to Main",
                Style = (Style)App.CurrentApp.Resources["buttonStyle"]
            };
            buttonBack.Clicked += (sender, e) =>
            {
                App.CurrentApp.MainPage = new SplashPage();
            };

            buttonLabel = new Button()
            {
                Text  = "Label Animation",
                Style = (Style)App.CurrentApp.Resources["buttonStyleGray"]
            };
            buttonLabel.Clicked += (sender, e) =>
            {
                App.CurrentApp.MainPage = new LabelEffects();
            };

            buttonAnimatedButton = new Button()
            {
                Text  = "Animated Button",
                Style = (Style)App.CurrentApp.Resources["buttonStyleGray"]
            };
            buttonAnimatedButton.Clicked += (sender, e) =>
            {
                App.CurrentApp.MainPage = new AnimatedButtonPage();
            };

            stackLayoutContent.Children.Add(buttonAnimatedButton);
            stackLayoutContent.Children.Add(buttonLabel);
            stackLayoutContent.Children.Add(buttonBack);
            await animation.Animate(stackLayoutContent);
        }