Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - kanth

#1
Hey everyone!
First i want to thank you all for your help, i have been cruising the forum as a guest for weeks and resolved all my problems thanks to you guys.

Well until now, my limited scripting knowledge is showing.
I've got a typewriting script and it works great, but i want to be able to skip the typewriter effect and show the entire line being typed at once (on mouse click or key press):

Code: ags

    Overlay *TypedText;
    
      void CommentNARRATOR(int delay, String text){ 
                                                          
 
     int x; 
     int y;
     AudioClip *sound;
     sound = aNarrator_voice;
     String displayedLine = "";
     int i = 0;
  
  while (i < text.Length) {
    
     displayedLine = String.Format ("%s%c", displayedLine, text.Chars[i]);
     TypedText = Overlay.CreateTextual(85, 530, 555, eFontnarrator, 65535, displayedLine);
    
    if (text.Chars[i] == ' ')
       Wait(delay/2);
    else if (text.Chars[i] == '[')
       Wait(delay/2);
    else {
      if (sound)
        sound.Play ();
       Wait(delay);
        
     }

     i++;

  }
 if (TypedText.Valid) 
     WaitMouseKey(TYPEnarrator_MAXIMUM_DISPLAY_TIME * (delay * 4));
     TypedText.Remove();
     }



I tried multiple things, but nothing worked.

if (mouse.IsButtonDown(eMouseLeft))
i = text.Length;
is a start but only type the first letter?
SMF spam blocked by CleanTalk