Пример #1
0
        public static void PlaySpriteSheet(GameObject gameObject, string resources_sprite_path, float frames, int frame_load, bool loop = true)
        {
            Animating a    = null;
            Animation anim = new Animation(resources_sprite_path, frames, loop);

            if (!gameObject.GetComponent <Animating>())
            {
                a = gameObject.AddComponent <Animating>();
            }
            else
            {
                a = gameObject.GetComponent <Animating>();
            }
            if (a.sprite_sheet != anim.sprite_path)
            {
                Sprite[] spr = Resources.LoadAll <Sprite>(resources_sprite_path);
                foreach (Sprite s in spr)
                {
                    anim.sprites.Add(s);
                }
                a.i          = 0;
                a.anim       = anim;
                a.frame_load = frame_load;
            }
        }
Пример #2
0
        private void PanGestureRecognizer_PanUpdated(object sender, PanUpdatedEventArgs e)
        {
            if (animationStarted)
            {
                return;
            }

            if (LogoImage.TranslationY > -50 && LogoImage.TranslationY <= 0)
            {
                LogoImage.TranslationY += e.TotalY;
                if (LogoImage.TranslationY > 0)
                {
                    LogoImage.TranslationY = 0;
                }
                return;
            }

            animationStarted = true;
            Animating?.Invoke();
            MaterialFrame.FadeTo(0.99, 160u * (uint)InputSL.Children.Count, Easing.CubicInOut); // Opacity 1.0 causes text above to become blurred?
            LogoImage.TranslateTo(0, Height * -0.35d, 400, Easing.CubicOut);
            TitleSL.FadeTo(1, 600, Easing.CubicInOut);
            TitleSL.TranslateTo(0, 0, 600, Easing.CubicInOut);
            ChevronSL.FadeTo(0, 100, Easing.CubicOut);
            EmailEntry.IsEnabled = PasswordEntry.IsEnabled = PasswordConfirmationEntry.IsEnabled = true;
            int t = 0;

            foreach (VisualElement v in InputSL.Children)
            {
                t += 160;
                v.TranslationX = -v.Width;
                Device.StartTimer(TimeSpan.FromMilliseconds(t), () =>
                {
                    if (!_signUp)
                    {
                        if (v == Button)
                        {
                            v.TranslateTo(0, -(PasswordConfirmationSL.Height + 4), 400, Easing.SinOut);
                            v.FadeTo(1, 400, Easing.SinOut);
                            return(false);
                        }
                        else if (v == PasswordConfirmationSL)
                        {
                            v.TranslateTo(0, 0, 400, Easing.SinOut);
                            return(false);
                        }
                    }
                    v.TranslateTo(0, 0, 400, Easing.SinOut);
                    v.FadeTo(1, 400, Easing.SinOut);
                    return(false);
                });
            }
            ThemeEngine.RefreshTheme(); // Set nav colours to what they should be on android
        }
Пример #3
0
 public static string GetSpriteSheet(GameObject gameObject)
 {
     if (gameObject.GetComponent <Animating>())
     {
         Animating a = gameObject.GetComponent <Animating>();
         return(a.anim.sprite_path);
     }
     else
     {
         return(null);
     }
 }
Пример #4
0
 public static bool OnFrame(GameObject gameObject, int frame)
 {
     if (gameObject.GetComponent <Animating>())
     {
         Animating a = gameObject.GetComponent <Animating>();
         if (a.i == frame)
         {
             return(true);
         }
         return(false);
     }
     return(false);
 }
Пример #5
0
 public void HideAnimated()
 {
     if (state == Animating.Closed)
     {
         return;
     }
     if (Properties.Settings.Default.PinConnectionBar)
     {
         return;
     }
     state = Animating.Hiding;
     timer.Stop();
     timer.Start();
 }
Пример #6
0
        public void ShowPinned()
        {
            if (!buttonPin.Checked)
            {
                buttonPin.Checked = true;
            }

            if (state == Animating.Open)
            {
                return;
            }

            Y     = 0;
            state = Animating.Open;
        }
Пример #7
0
        public void ShowAnimated()
        {
            if (state == Animating.Open)
            {
                return;
            }

            if (Properties.Settings.Default.PinConnectionBar)
            {
                ShowPinned();
                return;
            }
            state = Animating.Showing;
            timer.Stop();
            timer.Start();
        }
Пример #8
0
        private void PanGestureRecognizer_PanUpdated(object sender, PanUpdatedEventArgs e)
        {
            if (animationStarted)
            {
                return;
            }

            if (LogoImage.TranslationY > -50 && LogoImage.TranslationY <= 0)
            {
                LogoImage.TranslationY += e.TotalY;
                if (LogoImage.TranslationY > 0)
                {
                    LogoImage.TranslationY = 0;
                }
                return;
            }

            animationStarted = true;
            Animating?.Invoke();
            MaterialFrame.FadeTo(0.99, 160u * (uint)ButtonSL.Children.Count, Easing.CubicInOut); // Opacity 1.0 causes text above to become blurred?
            LogoImage.TranslateTo(0, Height * -0.35d, 400, Easing.CubicOut);
            TitleSL.FadeTo(1, 600, Easing.CubicInOut);
            TitleSL.TranslateTo(0, 0, 600, Easing.CubicInOut);
            ChevronSL.FadeTo(0, 100, Easing.CubicOut);
            int t = 0;

            foreach (Frame f in ButtonSL.Children)
            {
                t += 160;
                f.TranslationX = -f.Width;
                Device.StartTimer(TimeSpan.FromMilliseconds(t), () =>
                {
                    f.TranslateTo(0, 0, 400, Easing.SinOut);
                    f.FadeTo(1, 400, Easing.SinOut);
                    return(false);
                });
            }
            ThemeEngine.RefreshTheme(); // Set nav colours to what they should be on android
        }
Пример #9
0
 private void timer_Tick(object sender, EventArgs e)
 {
     if (state == Animating.Showing && Y < 0)
     {
         Y -= (int)(Y / ACCEL) - 1;
         if (Y == 0)
         {
             timer.Stop();
             state = Animating.Open;
         }
         Debug.WriteLine("Opening " + Y);
     }
     if (state == Animating.Hiding && Y > -(Height - HIDDEN_HEIGHT))
     {
         Y -= (int)((Y + Height - HIDDEN_HEIGHT) / ACCEL) + 1;
         if (Y == -(Height - HIDDEN_HEIGHT))
         {
             timer.Stop();
             state = Animating.Closed;
         }
         Debug.WriteLine("Closing " + Y);
     }
     timer.Interval = 100;
 }
Пример #10
0
 private void timer_Tick(object sender, EventArgs e)
 {
     if (state == Animating.Showing && Y < 0)
     {
         Y -= (int)(Y / ACCEL) - 1;
         if (Y == 0)
         {
             timer.Stop();
             state = Animating.Open;
         }
         Debug.WriteLine("Opening " + Y);
     }
     if (state == Animating.Hiding && Y > -(Height - HIDDEN_HEIGHT))
     {
         Y -= (int)((Y + Height - HIDDEN_HEIGHT) / ACCEL) + 1;
         if (Y == -(Height - HIDDEN_HEIGHT))
         {
             timer.Stop();
             state = Animating.Closed;
         }
         Debug.WriteLine("Closing " + Y);
     }
     timer.Interval = 100;
 }
Пример #11
0
        private void ShowAnimated()
        {
            if (state == Animating.Open)
                return;

            if (Properties.Settings.Default.PinConnectionBar)
            {
                ShowPinned();
                return;
            }
            state = Animating.Showing;
            timer.Stop();
            timer.Start();
        }
Пример #12
0
        public void ShowPinned()
        {
            if (!buttonPin.Checked)
                buttonPin.Checked = true;

            if (state == Animating.Open)
                return;

            Y = 0;
            state = Animating.Open;
        }
Пример #13
0
 public void HideAnimated()
 {
     if (state == Animating.Closed)
         return;
     if (Properties.Settings.Default.PinConnectionBar)
         return;
     state = Animating.Hiding;
     timer.Stop();
     timer.Start();
 }