rexrainbow / phaser3-rex-notes

Notes of phaser3 engine
MIT License
1.22k stars 263 forks source link

Typer:: Faster speed #207

Closed NickHatBoecker closed 3 years ago

NickHatBoecker commented 3 years ago

Hey Rex,

I'm using the typing plugin, combined with bbcode text. I would like to add a speed button, so the text should type faster if this button is down.

In the code it looks like the "speed" parameter is more of a delay. So first of all it's a little bit confusing that a smaller speed value is faster. But that's not the problem.

My default speed value is 35. When the speed button is down I set it to 1. But between these two values there is not much of a difference (or at least not enough for me). Is there anything I could do to speed it up more?

I created a codepen for this: https://codepen.io/NickHatBoecker/pen/yLoLQPE

Thank you in advance! Best regards Nick

rexrainbow commented 3 years ago

Typing plugin will type a new character when time-out. The minimum time-out interval is 16.666 (1000/60), which means that the typing speed will be larger than 16.667. So the typing speed 1 will be equal to 16.667, it is faster than typing speed 35 only twice. Set typing speed to 0 will print all text immediately.

Will try to fix this issue later.

rexrainbow commented 3 years ago

Add a PR to invoke typing callback in this case