Customize typewriter stop characters?

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Customize typewriter stop characters?

Post by Tony Li »

Hi,

You could add some code to the beginning of your overridden Play() method that checks for strings such as "...?" and inserts pause codes, such as "...\.?"
nicmar
Posts: 133
Joined: Wed Aug 21, 2019 2:39 am

Re: Customize typewriter stop characters?

Post by nicmar »

Interesting solution, so I manually set the pause codes, and don't use them in the stop codes property. That sounds like it would work! Thanks a lot :)
Working on SpaceChef - A wacky open world space western, featuring a chef with nothing to loose, after he loses everything.. ;) Follow our work on @BlueGooGames.
nicmar
Posts: 133
Joined: Wed Aug 21, 2019 2:39 am

Re: Customize typewriter stop characters?

Post by nicmar »

Hey, i noticed control.text was the wrong text to modify. So i changed it to here:

Code: Select all

        public override void StartTyping(string text, int fromIndex = 0)
        {
            text = text.Replace("...", "…").Replace("..", "…");
            base.StartTyping(text, fromIndex);
        }
Does this make sense? :)
Working on SpaceChef - A wacky open world space western, featuring a chef with nothing to loose, after he loses everything.. ;) Follow our work on @BlueGooGames.
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Customize typewriter stop characters?

Post by Tony Li »

Yes, that's correct. When Play() starts, control.text may not be correct. But the text variable that's passed to Play() is correct.
Post Reply