netgfx / Phaser-typewriter

A phaser helper for the typewriter effect
MIT License
38 stars 8 forks source link

Text changes the line while beeing written #1

Closed jppresents closed 8 years ago

jppresents commented 8 years ago

I have only quickly watched the example, but it really stuck out, that the last word in a line flips to the next line if it is too long to fit in the old line.

With the (really nice) handwriting sound in the background, this effect totally breaks the illusion of something physically beein written.

If possible the plugin should never try to write a word into the line if it will not fit.

netgfx commented 8 years ago

Well that can be easily fixed by placing \n in the actual text or modifying the maxWidth value to accommodate and wrap the text on a space. I'm using maxWidth value of Phaser BitmapText for this.

ztiromoritz commented 8 years ago

Another solution could be to render the whole text, set alpha of every letter to 0, and then reveal the text letter by letter. See my pull request for this solution. (https://github.com/netgfx/Phaser-typewriter/pull/2/files) I already did sth. like this with html/jquery once.

netgfx commented 8 years ago

Very nice addition, thanks for the pull request, I already merged it in.

halflings commented 8 years ago

It would be a good idea to update the demo with this fix! I was also bothered with that line "jump", so it's good to know that it has been fixed!

netgfx commented 8 years ago

Done!

halflings commented 8 years ago

Awesome! :+1: