Example #1
0
 public static Animation Subtitle(string text, double duration)
 {
     Animation anim = new Animation(duration);
     Event.Register(anim, Procedure.Started, (sender, e) =>
     {
         subtitle.Visibility = Visibility.Visible;
         subtitle.Text = text;
     });
     Event.Register(anim, Procedure.Completed, (sender, e) =>
     {
         subtitle.Visibility = Visibility.Collapsed;
     });
     return anim;
 }
Example #2
0
        public Movement(MovementTemplate template, Actor actor)
        {
            Template = template;
            Actor = actor;

            Animation = template.Animation.Create(actor);
            Event.Register(Animation, Completed, TestContinuation);

            MovementAnimation = new MovementAnimation(actor);
            MovementAnimation.Duration = template.Animation.Duration / template.Speed;

            Completion = template.Completion.Create(actor);
            Event.Register(Completion, Completed, TestMovement);

            timeout = new Animation(0.1);
            Event.Register(timeout, Completed, TestMovement);

            Event.Register(this, Started, TestMovement);
        }