예제 #1
0
        //==============//
        public static AnimationView LightningAnimation()
        {
            AnimationView view = new AnimationView();

            view.Animation = "lightning.json";
            return(view);
        }
예제 #2
0
        void SetContent()
        {
            if (_contentView == null)
            {
                return;
            }

            _rootLayout = new RelativeLayout();

            var animationWidth = App.ScreenWidth / 2;

            animationView = new AnimationView
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                AutoPlay          = true,
                Speed             = 0.5f,
                Duration          = TimeSpan.FromMilliseconds(1500),
            };

            _rootLayout.Children.Add(_contentView,
                                     xConstraint: Constraint.Constant(0),
                                     yConstraint: Constraint.Constant(0),
                                     widthConstraint: Constraint.RelativeToParent(p => Width),
                                     heightConstraint: Constraint.RelativeToParent(p => Height));
            _rootLayout.Children.Add(animationView,
                                     xConstraint: Constraint.Constant(0),
                                     yConstraint: Constraint.Constant(0));

            animationView.SetBinding(AnimationView.AnimationProperty, nameof(BaseViewModel.Animation), BindingMode.TwoWay);
            animationView.SetBinding(AnimationView.IsVisibleProperty, nameof(BaseViewModel.IsAnimationVisible), BindingMode.TwoWay);

            Content = _rootLayout;
        }
예제 #3
0
파일: App.xaml.cs 프로젝트: malirezai/Hunt
        protected override void OnStart()
        {
            MobileCenter.Start($"android={Keys.MobileCenter.AndroidToken};ios={Keys.MobileCenter.iOSToken}",
                               typeof(Analytics), typeof(Crashes), typeof(Push));

            Push.PushNotificationReceived += OnIncomingPayloadReceived;
            CrossConnectivity.Current.ConnectivityChanged += OnConnectivityChanged;
            if (false)
            {
                var l = new AnimationView();
            }                                                     //Warm up the library

            base.OnStart();

            //Load up the registered player, if one exists
            var installId = MobileCenter.GetInstallIdAsync().Result;

            Logger.Instance.WriteLine($"Install ID: {installId}");

            LoadRegisteredPlayer();
            SetMainPage();

            EvaluateConnectivity();
            WakeUpServer();
        }
예제 #4
0
        public App()
        {
            InitializeComponent();
            AnimationView view = new AnimationView();

            MainPage = new MainPage();
        }
예제 #5
0
 public MainPage()
 {
     InitializeComponent();
     var animationView = new AnimationView()
     {
     };
 }
 public void Update()
 {
     spelling.Update();
     building.Update();
     if (building.model.isSelectNow)
     {
         building.model.isSelectNow  = false;
         spelling.model.contentIndex = building.model.selectedIndex;
         spelling.Populate();
     }
     else if (spelling.model.isExitNow)
     {
         if (1 <= spelling.model.answerCount)
         {
             building.model.Answer(spelling.model.answerCount);
         }
         spelling.model.isExitNow = false;
         building.model.state     = "spellingToBuilding";
     }
     else if (spelling.model.isAnswerAllNow)
     {
         spelling.model.isAnswerAllNow = false;
         building.model.state          = "spellingToBuilding";
         building.model.Complete();
     }
     AnimationView.SetState(view.state, building.model.state);
 }
예제 #7
0
        void UpdateAnimationViewStateLabel(AnimationView aniview, Label _stateLabel)
        {
            AnimationViewState _state = aniview.State;

            if (_state == AnimationViewState.NotReady)
            {
                _stateLabel.Text = "<font_size=32>State = Not Ready</font_size>";
            }
            else if (_state == AnimationViewState.Play)
            {
                _stateLabel.Text = "<font_size=32>State = Playing</font_size>";
            }
            else if (_state == AnimationViewState.ReversedPlay)
            {
                _stateLabel.Text = "<font_size=32>State = Reverse Playing</font_size>";
            }
            else if (_state == AnimationViewState.Pause)
            {
                _stateLabel.Text = "<font_size=32>State = Paused</font_size>";
            }
            else if (_state == AnimationViewState.Stop)
            {
                _stateLabel.Text = "<font_size=32>State = Stopped</font_size>";
            }
        }
예제 #8
0
        public SnackViewCell()
        {
            InitializeComponent();

            MessagingCenter.Subscribe <SnackViewCell>(this, "Animate", async(arg) =>
            {
                if (EnablePacman)
                {
                    if (Nome.Text == AllSnacksPage.selectedItemBinding)
                    {
                        pacMananimation = new AnimationView
                        {
                            Animation            = "pacman0.6.json",
                            Scale                = 1.6,
                            Loop                 = true,
                            HorizontalOptions    = LayoutOptions.StartAndExpand,
                            VerticalOptions      = LayoutOptions.FillAndExpand,
                            AutoPlay             = true,
                            HardwareAcceleration = true,
                            InputTransparent     = true,
                            IsVisible            = false,
                            Speed                = 4,
                        };

                        Grid.Children.Add(pacMananimation);
                        pacManAnimate();
                    }
                }
                else
                {
                    await QtaRefresh();
                }
            });
        }
        /// <summary>
        /// Set the loading control
        /// </summary>
        public void SetLoadingControl()
        {
            var backLoader = new BoxView
            {
                Opacity         = 0.6,
                BackgroundColor = Color.Black
            };

            var activityIndicator = new AnimationView
            {
                Animation         = AnimationFile,
                Loop              = true,
                IsEnabled         = true,
                AutoPlay          = true,
                IsVisible         = false,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                Margin            = new Thickness(130, default(int))
            };

            layout.Children.Add(backLoader, left: default(int), top: default(int));
            activityIndicator.SetBinding(IsVisibleProperty, nameof(IsBusy));
            backLoader.SetBinding(IsVisibleProperty, nameof(IsBusy));
            layout.Children.Add(activityIndicator, left: default(int), top: default(int));
        }
예제 #10
0
        protected async Task PlayAnimation(LottieAnimation animationName)
        {
            if (AnimationView.IsAnimating)
            {
                return;
            }

            await AnimationView.SetAnimationAsync(System.IO.Path.Combine(LOTTIE_ANIMATIONS_DIRECTORY, animationName.ToString() + ".json"), LottieAnimationView.CacheStrategy.Strong);

            if (FadesEnabled)
            {
                ((Storyboard)Resources["AnimationFadeIn"])?.Begin();
            }

            AnimationView.Speed       = 0.5f;
            AnimationView.RepeatCount = 0;
            AnimationView.PlayAnimation();

            await Task.Delay(2500);

            if (FadesEnabled)
            {
                ((Storyboard)Resources["AnimationFadeOut"])?.Begin();
            }
        }
        public void Animate(int edgeThreshold, int edgesAtOnce)
        {
            AnimationView av = new AnimationView(new Bitmap(this.model.Image), edgeThreshold, edgesAtOnce);

            av.Show();

            av.Animate();
        }
예제 #12
0
 public void Update()
 {
     UpdateButtons();
     for (int index = 0; index < DataUtil.Length(view.cellStates); index++)
     {
         AnimationView.SetState(view.cellStates[index], model.cellStates[index]);
     }
 }
예제 #13
0
        private async void AnimationView_OnOnClick(object sender, EventArgs e)
        {
            AnimationView.PlayFrameSegment(44, 60);
            await Task.Delay(700);

            AnimationView.Animation = "MainButton.json";
            //await Task.Delay(5000);
            await Navigation.PushAsync(new SearchPageXama(await ApiHelper.getInstance().Recommend()));
        }
 private void _on_Checkpoint_body_entered(object body)
 {
     if ((body as Node).IsInGroup("player") && Desativado)
     {
         SingleMonophonicEmiterBLL.Reproduzir(CheckpointSound);
         AnimationView.ExecutarAnimacao(true, "Active", PersonagemDTO);
         BugsBLL.Spawnpoint = GlobalPosition;
     }
 }
예제 #15
0
        public ProductCard(Binary binary, string cardType, FilterState state)
        {
            id          = r.Next(9999);
            this.binary = binary;
            animation   = new AnimationView {
                Loop          = true, AutoPlay = true, Animation = "loading.json",
                HeightRequest = 50, WidthRequest = 50
            };
            TapGestureRecognizer tp = new TapGestureRecognizer();

            tp.Tapped += OnTapped;
            v          = new CardScrollContent(binary, tp, cardType, state);
            content    = new B {
                IsVisible = false, Children = { v }
            };
            fader = new B {
                Opacity = 0, BackgroundColor = Color.LightGray
            };
            container = new B1()
            {
                Children = { fader, content }
            };
            content_loading = new B(0, 0, 1, 1)
            {
                Children = { new StackLayout   {
                                 Children =
                                 {
                                     new Label {
                                         Text      = "Hämtar", FontAttributes = FontAttributes.Bold,
                                         FontSize  = 30,
                                         TextColor = Color.White
                                     }, animation
                                 },
                                 HorizontalOptions = LayoutOptions.CenterAndExpand, VerticalOptions =
                                     LayoutOptions.CenterAndExpand
                             } }, BackgroundColor = Color.LightGray
            };
            Padding           = 0;
            CornerRadius      = 30;
            HeightRequest     = 300;
            IsClippedToBounds = true;
            HorizontalOptions = LayoutOptions.FillAndExpand;
            Content           = new AbsoluteLayout {
                Children =
                {
                    product_image,
                    icon,         new DefaultFrontCard(binary,state), container,
                    content_loading
                }
            };
            TapGestureRecognizer tap = new TapGestureRecognizer();

            tap.Tapped += OnTapped;
            GestureRecognizers.Add(tap);
            LoadContent();
        }
예제 #16
0
 public MyPage()
 {
     Content = new AnimationView()
     {
         Animation = "LottieLogo1.json",
         AutoPlay  = true,
         PlaybackFinishedCommand = new Command(_ => _show.Invoke(null, null))
     };
     BackgroundColor = Color.FromRgb(93, 206, 194);
 }
예제 #17
0
        void _battle_BattleFinshed(object sender, BattleFinishedEventArgs e)
        {
            Flash.Show(this);
            LogoBack.IsVisible = true;
            if (e.Winner == Current)
            {
                Sound.WIN();
                Enemy.AddBattleHistory(Current, UserProfile.HISTORY_TYPE.LOSE_OFFLINE);
                Current.AddBattleHistory(Enemy, UserProfile.HISTORY_TYPE.WIN);
                var i = 0;
                Device.StartTimer(TimeSpan.FromMilliseconds(50), () =>
                {
                    BattleComment.Show(BattleCommentAreaForEnemy, Enemy.LoseComment);
                    BattleComment.Show(BattleCommentAreaForCurrent, Current.WinComment);
                    i++;
                    return(i != 10);
                });
                Device.BeginInvokeOnMainThread(() =>
                {
                    AnimationView.Animation = "animation_win.json";
                    AnimationView.Play();
                });
                Device.StartTimer(TimeSpan.FromSeconds(3), () =>
                {
                    ShowFourth();
                    return(false);
                });
            }
            else
            {
                Sound.LOSE();
                Enemy.AddBattleHistory(Current, UserProfile.HISTORY_TYPE.WIN_OFFLINE);
                Current.AddBattleHistory(Enemy, UserProfile.HISTORY_TYPE.LOSE);

                var i = 0;
                Device.StartTimer(TimeSpan.FromMilliseconds(50), () =>
                {
                    BattleComment.Show(BattleCommentAreaForCurrent, Current.LoseComment);
                    BattleComment.Show(BattleCommentAreaForEnemy, Enemy.WinComment);
                    i++;
                    return(i != 10);
                });
                DependencyService.Get <IDeviceService>().PlayVibrate();
                Device.BeginInvokeOnMainThread(() =>
                {
                    AnimationView.Animation = "animation_lose.json";
                    AnimationView.Play();
                });
                Device.StartTimer(TimeSpan.FromSeconds(3), () =>
                {
                    Back();
                    return(false);
                });
            }
        }
        public MyPage()
        {
            var x             = "Off";
            var animationView = new AnimationView()
            {
                Animation         = "https://www.lottiefiles.com/storage/datafiles/kuhWLbtVdLIP4PK/data.json",
                Loop              = true,
                AutoPlay          = false,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                HorizontalOptions = LayoutOptions.FillAndExpand,
                IsEnabled         = true,
                IsVisible         = true
            };
            //animationView.IsPlaying = true;
            var playButton = new Button()
            {
                Text = "Play"
            };

            playButton.Clicked += (sender, e) => animationView.Play();


            var tap = new TapGestureRecognizer
            {
                Command = new Command(() =>
                {
                    animationView.IsPlaying = true;
                    if (x == "Off")
                    {
                        x = "On";
                    }
                    else
                    {
                        x = "Off";
                    }
                }),
                NumberOfTapsRequired = 1
            };

            animationView.GestureRecognizers.Add(tap);

            Content = new StackLayout
            {
                Children =
                {
                    animationView,
                    playButton,
                    new Label {
                        Text = x
                    }
                },
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                VerticalOptions   = LayoutOptions.CenterAndExpand
            };
        }
 public override void _PhysicsProcess(float delta)
 {
     if (!personagemDTO.Vivo && personagemDTO.AnimationPlayer.CurrentAnimation != "Destruido" && personagemDTO.AnimationPlayer.CurrentAnimation != "")
     {
         SingleMonophonicEmiterBLL.Reproduzir(BoxSound);
     }
     if (!personagemDTO.Vivo)
     {
         AnimationView.ExecutarAnimacao(true, "Destruido", personagemDTO);
     }
 }
 private void DrawAnimationSettingsEditor(AnimationView animationView)
 {
     GUI.enabled = false;
     EditorGUILayout.LabelField("Loop", EditorStyles.miniLabel, GUILayout.Width(25));
     EditorGUILayout.Toggle(animationView.AnimationClipSettings.loopTime, GUILayout.Width(16));
     EditorGUILayout.LabelField("Loop blend", EditorStyles.miniLabel, GUILayout.Width(55));
     EditorGUILayout.Toggle(animationView.AnimationClipSettings.loopBlend, GUILayout.Width(16));
     EditorGUILayout.LabelField("Default", EditorStyles.miniLabel, GUILayout.Width(37));
     EditorGUILayout.Toggle(animationView.Default, GUILayout.Width(16));
     GUI.enabled = true;
 }
예제 #21
0
        public void Handle_OnFinish(object sender, EventArgs e)
        {
            var parentAnimation  = new Animation();
            var fadeOutAnimation = new Animation(v => AnimationView.FadeTo(0, 250, Easing.CubicInOut));
            var fadeInAnimation  = new Animation(v => TextLabel.FadeTo(1, 250, Easing.CubicInOut));

            parentAnimation.Add(0, 0.5, fadeOutAnimation);
            parentAnimation.Add(0.5, 1, fadeInAnimation);

            parentAnimation.Commit(this, "ChildAnimations", 16, 500, null);
        }
        public LottieAnimationPage()
        {
            InitializeComponent();
            this.BindingContext = viewModel = new LottieAnimationViewModel();
            NavigationPage.SetHasNavigationBar(this, false);

            MessagingCenter.Subscribe <LottieAnimationViewModel>(this, "play", (obj) =>
            {
                AnimationView.Play();
            });
        }
 private void DrawAnimationEditor(AnimationView animationView, int index)
 {
     EditorGUILayout.LabelField(string.Format("{0} -", index), GUILayout.Width(20));
     animationView.Checked = EditorGUILayout.Toggle(animationView.Checked, GUILayout.Width(20));
     EditorGUILayout.LabelField(animationView.Animation.name, GUILayout.Width(160));
     GUILayout.FlexibleSpace();
     if (GUILayout.Button("Ping", GUILayout.Width(50)))
     {
         EditorGUIUtility.PingObject(_animations[index].Animation);
     }
     DrawAnimationSettingsEditor(animationView);
 }
예제 #24
0
 public NotificacionCargando()
 {
     Content = new AnimationView
     {
         AutoPlay          = true,
         Animation         = "loader.json",
         Loop              = true,
         WidthRequest      = App.DisplayScreenWidth,
         HeightRequest     = App.DisplayScreenHeight,
         VerticalOptions   = LayoutOptions.CenterAndExpand,
         HorizontalOptions = LayoutOptions.CenterAndExpand,
     };
 }
 private void AnimationButtonOnClicked(object sender, System.EventArgs e)
 {
     if (AnimationView.IsPlaying)
     {
         AnimationView.Pause();
         AnimationButton.Text = "Start Animation";
     }
     else
     {
         AnimationView.Play();
         AnimationButton.Text = "Stop Animation";
     }
 }
예제 #26
0
        public App()
        {
            InitializeComponent();

            if (Device.RuntimePlatform == Device.iOS)
            {
                MainPage = new AnimationView();
            }
            else
            {
                MainPage = new NavigationPage(new AnimationView());
            }
        }
예제 #27
0
 private void Animar()
 {
     if (personagemDTO.Vivo && personagemDTO.AnimationPlayer.CurrentAnimation != "Hit")
     {
         AnimationView.ExecutarAnimacao(personagemDTO.Direcao == new Vector2(0, 0), "Idle", personagemDTO);
         AnimationView.ExecutarAnimacao(personagemDTO.Direcao != new Vector2(0, 0), "Walk", personagemDTO);
     }
     if (!personagemDTO.Vivo && personagemDTO.AnimationPlayer.CurrentAnimation != "Morte" && personagemDTO.AnimationPlayer.CurrentAnimation != "")
     {
         SingleMonophonicEmiterBLL.Reproduzir(KillSound);
     }
     AnimationView.ExecutarAnimacao(!personagemDTO.Vivo, "Morte", personagemDTO);
 }
예제 #28
0
 private void _on_SensorCabeca_body_entered(object body)
 {
     if (personagemDTO.Vivo)
     {
         if ((body as Node).IsInGroup("player"))
         {
             AnimationView.ExecutarAnimacao(personagemDTO.Vivo, "Hit", personagemDTO);
             (body as JogadorController).personagemDTO.Gravidade = (body as JogadorController).personagemDTO.ForcaPulo * 1.2f;
             ArmaDireita.Atirar(personagemDTO, false);
             ArmaEquerda.Atirar(personagemDTO, true);
         }
     }
 }
예제 #29
0
        protected override void OnAppearing()
        {
            AnimationView.Play();

            Device.StartTimer(TimeSpan.FromMilliseconds(2500), () =>
            {
                if (isPageLoaded)
                {
                    AnimationView.Play();
                }

                return(isPageLoaded);
            });
        }
예제 #30
0
        protected override void OnApplyTemplate()
        {
            LayoutRoot = GetTemplateChild(nameof(LayoutRoot)) as AspectView;
            Player     = GetTemplateChild(nameof(Player)) as AnimationView;

            Player.FirstFrameRendered += Player_FirstFrameRendered;

            _templateApplied = true;

            if (_message != null)
            {
                UpdateMessage(_message);
            }
        }