Hi hi,
Anyone know how does Font:WrapText work?
I wrote this line:
FontWrapText("Please press Shift and type you current plan.",15,10,15)
but nothing was printed.
Thanks.
Font:WrapText
Moderator: Moderators
Re: Font:WrapText
check your syntax
wiki wrote:font:WrapText
( string "text", number max_width [, number max_height [, number size ] ])
-> nil | string wrappedText, number lines
Re: Font:WrapText
if you write it with the [] brackets it doesn't work at all.
I think they are use to explain how it works.
Any ideas? thanks.
I think they are use to explain how it works.
Any ideas? thanks.
Re: Font:WrapText
appearently the function returns the new wrapped text. with newlines \n inserted or somethingstring wrappedText
Re: Font:WrapText
I tried this:
wrappedText, lineCount = myFont:WrapText("text to wrapped", 30, 30, 30 )
myFont:Print(wrappedText,x,y,fontsize,"O")
My results are:
text to ...
it doesn't seem to insert \n
Any ideas?
wrappedText, lineCount = myFont:WrapText("text to wrapped", 30, 30, 30 )
myFont:Print(wrappedText,x,y,fontsize,"O")
My results are:
text to ...
it doesn't seem to insert \n
Any ideas?
Re: Font:WrapText
You set the function argument max_height to 30, which obviously is only enough for 1 line. Btw you don't need to set it at all, you can leave it out or set it to nil when you need to set the fontsize argument (when fontsize isn't defined it uses the native one defined when the font was created with gl.CreateFont).
Re: Font:WrapText
Thanks lots!
I manage to get it to work =D
I manage to get it to work =D