Beispiel #1
0
 public TextSection(uint startingCharacter, uint length, ITextAnimation effect, bool loop = false, float animationSpeed = 1f)
 {
     this.Start          = startingCharacter;
     this.Length         = length;
     this.effect         = effect ?? throw new System.ArgumentNullException(nameof(effect));
     this.loop           = loop;
     this.animationSpeed = animationSpeed;
     elapsedTime         = 0f;
     Stop();
 }
Beispiel #2
0
 public void AddEffectToSelection(ITextAnimation effect)
 {
     if (Animator != null && Field != null && SelectionLength != 0)
     {
         AdjustedSelection selection = GetAdjustedStartAndEnd();
         if (selection.Length > 0)
         {
             Animator.AddSection(new TextSection(
                                     (uint)selection.Start,
                                     (uint)selection.Length,
                                     effect,
                                     true
                                     ));
             ClearSelection();
         }
     }
 }