Closed BlizzCrafter closed 5 years ago
Hi @sqrMin1, thank you very much for this pull request! While your improvements are very good (and nicely written) I will not merge them because I finally got to implement two things I wanted to do for a while now, which makes your PR redundant:
Hope you find the new version useful (its not out yet but stable if you want to build it), I think it adds really nice features. It does break the API a little bit but nothing too complicated to update.
Cheers :)
Hey @RonenNess
You are enhancing the library in an even better way. Looking forward to the new release! 👍
(animations would have been next on my list, hehe)
The TypeWriterParagraph adds the type writer effect to text. It inherits from MultiColorParagraph to support multiple colors.
As I inherited from the MultiColorParagraph I noticed that the drawing of the outline is the same code block as used by the base Paragraph class (compare Paragraph vs MultiColorParagraph)
So I decided to wrap this up in a protected void to make it available in derived classes like the MultiColorParagraph and the new TypeWriterParagraph.
Commit 9e6c93e opens up some important members of the MultiColorParagraph so that classes that inherit from it (like the new TypeWriterParagraph) can benefit from.
It's possible to change the speed of the type writer effect by overloading the ctor and modifying the timeBetweenChars value.
This is just the basic implementation with a basic effect. In the future this TypeWriterParagraph could be modified to work the same way as the MultiColorParagraph by setting speed values directly in the text (like a ColorInstruction).