Jump to content

[HELP] Line Break


off

Recommended Posts

Posted

I am writing a text, but do not know how to break the line.

Example:

local text1 = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas nec aliquam mi, nec accumsan augue. Quisque ornare sollicitudin nisl. Vivamus mi orci, pellentesque porttitor sem non, sodales dictum risus. Praesent magna orci, ultrices in nisl quis, euismod dictum mauris. Curabitur cursus laoreet felis sed ullamcorper. Proin faucibus id velit a consequat. Nulla facilisi. Sed fringilla elit nec tortor imperdiet viverra. Curabitur quis neque nec eros feugiat fringilla. Nam a est a mauris mattis cursus sed vitae dolor. Nam non justo blandit, mattis sem eget, pellentesque nibh. Proin quis luctus dolor." 
  
function TextOne() 
    dxDrawText(text1, 269, 171, 100, 100, tocolor(0, 0, 0, 127), 1, "sans", "left", "top", false, false, true) 
end 
addEvent("onClientPlayerSpawn", true) 
addEventHandler("onClientRender", root, TextOne) 

Obs:In this example the text this with broken lines, because the forum post system does this automatically.

Sorry my bad english.

i5 7400 3.0GHZ
B150M-GAMING 3 DDR4
HyperX FURY 8GB 2133Mhz DDR4
Galax GTX 1060 6GB OC

Posted
You could also do something like this:
local text = "Another \ 
New \ 
Line!" 

That's inefficient. You should use [[ ]] instead.

If I helped you, please click the like button on the right ;) Thanks!

Posted
You could also do something like this:
local text = "Another \ 
New \ 
Line!" 

That's inefficient. You should use [[ ]] instead.

He can use /n for every new line instead of these.

Posted
You could also do something like this:
local text = "Another \ 
New \ 
Line!" 

That's inefficient. You should use [[ ]] instead.

Yes, you can also do this:

local text1 = [[Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
Maecenas nec aliquam mi, nec accumsan augue. 
Quisque ornare sollicitudin nisl. Vivamus mi orci, pellentesque porttitor sem non, sodales dictum risus. 
Praesent magna orci, ultrices in nisl quis, euismod dictum mauris. 
Curabitur cursus laoreet felis sed ullamcorper. 
Proin faucibus id velit a consequat. Nulla facilisi. 
Sed fringilla elit nec tortor imperdiet viverra. 
Curabitur quis neque nec eros feugiat fringilla. 
Nam a est a mauris mattis cursus sed vitae dolor. 
Nam non justo blandit, mattis sem eget, pellentesque nibh. Proin quis luctus dolor.]] 

Please do not PM me with scripting related question nor support, use the forums instead.

Posted

Isn't it better to set wordbreak to true?

dxDrawText(text1, 269, 171, 100, 100, tocolor(0, 0, 0, 127), 1, "sans", "left", "top", false, true, true) 

Posted
You could also do something like this:
local text = "Another \ 
New \ 
Line!" 

That's inefficient. You should use [[ ]] instead.

Yes, you can also do this:

local text1 = [[Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
Maecenas nec aliquam mi, nec accumsan augue. 
Quisque ornare sollicitudin nisl. Vivamus mi orci, pellentesque porttitor sem non, sodales dictum risus. 
Praesent magna orci, ultrices in nisl quis, euismod dictum mauris. 
Curabitur cursus laoreet felis sed ullamcorper. 
Proin faucibus id velit a consequat. Nulla facilisi. 
Sed fringilla elit nec tortor imperdiet viverra. 
Curabitur quis neque nec eros feugiat fringilla. 
Nam a est a mauris mattis cursus sed vitae dolor. 
Nam non justo blandit, mattis sem eget, pellentesque nibh. Proin quis luctus dolor.]] 

Thank you all. Is working with this: [[Text]].

i5 7400 3.0GHZ
B150M-GAMING 3 DDR4
HyperX FURY 8GB 2133Mhz DDR4
Galax GTX 1060 6GB OC

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...