예제 #1
0
        void DelayAction(Action action, int duration)
        {
            HandyAnimator delay = HandyAnimator.OfNothing(duration);

            delay.After += action;
            delay.core.Start();
        }
예제 #2
0
 public void Start()
 {
     anim = HandyAnimator.OfFloat((float)Math.PI * 2, 0, LapDuration);
     anim.core.SetInterpolator(new LinearInterpolator());
     anim.Update          += (value) => CurAngle = (float)value;
     anim.core.RepeatCount = -1;
     anim.core.Start();
 }
예제 #3
0
 void AnimateSwitch(float fromX, float toX, Action action)
 {
     switchAnim = HandyAnimator.OfFloat(fromX, toX, SwitchDuration);
     switchAnim.core.SetInterpolator(new DecelerateInterpolator(SwitchEasingFactor));
     switchAnim.Update += (value) => pivot.X = (float)value;
     switchAnim.After  += action;
     switchAnim.core.Start();
 }
예제 #4
0
        public void AnimateAppearance()
        {
            HandyAnimator anim = HandyAnimator.OfFloat(0, 1, AppearanceDuration);

            anim.Update += (value) => VisiblePart = (float)(value);
            anim.core.Start();
            SoundMaster.PlaySound(SoundMaster.SegmentBornSound);
        }
예제 #5
0
 void AnimateDivingTo(int divingTimeDest)
 {
     diveAnim?.core.Cancel();
     diveAnim = HandyAnimator.OfFloat(currentDiveTime,
                                      divingTimeDest, (int)Math.Abs(currentDiveTime - divingTimeDest));
     diveAnim.Update += (value) => CurrentDiveTime = (float)value;
     diveAnim.core.Start();
 }
예제 #6
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);
            SoundMaster.LoadSounds();
            InitScenes();
            HandyAnimator delayAnim = HandyAnimator.OfNothing(500);

            delayAnim.After += () => LogoScene.Instance.Show(Side.Right);
            delayAnim.core.Start();
        }
예제 #7
0
        public void AnimateAppearance()
        {
            HandyAnimator apAnim = HandyAnimator.OfFloat(0, 1, BirthDuration);

            apAnim.core.SetInterpolator(new OvershootInterpolator(2));
            apAnim.core.StartDelay      = (int)(random.NextDouble() * MaxBirthDelay);
            apAnim.Update              += (value) => BirthScaleFactor = (float)value;
            apAnim.core.AnimationStart += (sender, e)
                                          => SoundMaster.PlaySound(SoundMaster.PointBornSound);
            apAnim.core.Start();
        }
예제 #8
0
 protected override void OnDestroy()
 {
     base.OnDestroy();
     TaskRegistrator.CancelAllTasks();
     TouchHandler.RemoveAllListeners();
     HandyAnimator.OnActivityDestroy();
     SoundMaster.StopAllSounds();
     SoundMaster.UnloadSounds();
     RemoveScenes();
     GameView.Instance = null;
     GC.Collect();
 }
예제 #9
0
 void KillAnims()
 {
     foreach (HandyAnimator anim in new HandyAnimator[]
              { exitAnim, sureAnim, replayAnim })
     {
         if (anim != null && anim.core.IsRunning)
         {
             anim.core.Cancel();
         }
     }
     exitAnim = sureAnim = replayAnim = null;
 }
예제 #10
0
        static public void ChangeBackgroundColor(bool toBlack)
        {
            float coefDest = (toBlack) ? 0 : 1;
            var   prefs    = Application.Context.GetSharedPreferences("AppPrefs",
                                                                      FileCreationMode.Private);
            var editor = prefs.Edit();

            editor.PutFloat("background", coefDest);
            editor.Commit();

            bgAnim?.core.Cancel();
            bgAnim = HandyAnimator.OfFloat(currentBgCoef, coefDest,
                                           (int)(Math.Abs(currentBgCoef - coefDest) * BgAnimDuration));
            bgAnim.core.SetInterpolator(new DecelerateInterpolator(1.6f));
            bgAnim.Update += (value) => CurrentBgCoef = (float)value;
            bgAnim.core.Start();
        }
예제 #11
0
 public void Stop()
 {
     anim.core.Cancel();
     anim = null;
 }