Dialog box : print one word at a time until the whole conversation is shown

Hi Sidermaniac,

At the moment I can see the text overlapping happening between the first line and the second line

I am using Iphone 6s as the viewing device in simulator, can the lua be adjusted so that there is no text overlapping when different devices are selected?

Also would it be possible to have like a simple button which when pressed will goto the next line of text, rather than all sentences showing at the same time?

The overlapping is because of the font size.   

There are two variables that control the spacing for the fonts Dialog._x and Dialog._y.  

Dialog._y is the location along the y axis that the line is printed. So adding 15 to it, moves it to the next line. 

On line 103 change 15 to a higher value and it will start to separate. 

Dialog.\_x, Dialog.\_y, Dialog.\_char\_index = Dialog.rect.contentBounds.xMin + 3, Dialog.\_y + 15, 1

But that isn’t an across the board solution. You are going to have to set the font used rather than using the default font.  

That way you know how big the font will be and can use the same value on every phone to get to the next line.   

Line 93 controls what happens when the a line is done printing. 

if Dialog.\_char\_index \> #Dialog.\_lines[Dialog.\_line\_index] then 

Inside that if statement you could use timer.pause() and on a button click use timer.resume() to print the next line. 

Thanks sidermaniac, this code will be quite useful for me. I will need to reuse it everytime there is a dialogue involved. Thanks.