I did see some old posts on this but no resolution.
I have a text box and use txt_set to set text in it. I am running a test and first started with "Test\nLine2" but that didn't work as I get TESTxLINE2 where X is some strange character.
Next I decided to use string.format and create a string s but that doesn't work either.
How do I get a newline to put in a text box or is that not possible. I am on AM 4.1.5 Desktop.
Thank you.
Newline - again
-
- Posts: 5339
- Joined: Thu Jul 27, 2017 12:22 am
Re: Newline - again
Just create a txt_add for each line
-
- Posts: 122
- Joined: Thu Sep 12, 2019 8:27 pm
Re: Newline - again
Okay. So it's smart enough to add a line for each txt_add. Definitely never would have thought of that!
I'd like to suggest the API Wiki be updated to include this information.
Thank you.
Edit. Reread this and realize what you said. I can do that but that's a pain if you have a bunch of multiline stuff.
I'd like to suggest the API Wiki be updated to include this information.
Thank you.
Edit. Reread this and realize what you said. I can do that but that's a pain if you have a bunch of multiline stuff.
Re: Newline - again
make any simple function to do what you want.
there are many different ways and you can make it as simple or as complex as you like.
Code: Select all
function text_box_blah (text,line)
-- do some stuff for spacing or whatever
line = line * 15
-- do some stuff for printing or formatting
txt_add(text, "font:arimo_regular.ttf; size:14; color: black; halign:left;", 0, line, 200, 200)
end
-- send text and the line number
text_box_blah("hello",0) -- line 0
text_box_blah("world",1) -- line 1
text_box_blah("blah blah blah",2) -- line 2
Joe. CISSP, MSc.
-
- Posts: 122
- Joined: Thu Sep 12, 2019 8:27 pm
Re: Newline - again
Thanks. I'll look at it.