ambiera home ambiera home

Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name:  Password:
Ambiera Forum > CopperCube > Feature requests and bug reports
Line breaks with /n
Author Text

ishmaru
Registered User
Quote
2019-01-27 15:53:16

Im making a sort of message console.

I have a 2D overlay with some text. I have the multi-line option enabled.
I'm trying to edit this text using JS and tried to make a line break with the "/n" special character and was shocked that this did not work.

Can this be added to Coppercube?


srfstudio
Registered User
Quote
2019-01-27 17:25:46

Perfect timing to return a favor for your dynamic-variable solution :)
I also tried this and failed but the + "\r\n" + worked fine :)

//////Edit
...sorry, it works only when saving to txt/ini :(
var text1 = 'First line';
text1 += '\r\n';
text1 += 'Second line';
ccbWriteFileContent('tekst.txt', text1);
ccbSetCopperCubeVariable('tekst1', text1);
This will save a txt file with multi-lines but it's not working for 2D Overlay.

//////Edit Edit
It does work :) I just forgot to choose Multiline in Alignment of 2D Overlay :)


ishmaru
Registered User
Quote
2019-01-28 03:43:41

You are right '\r\n' works great thank you!


xanimalkingx
Registered User
Quote
2019-02-10 19:38:32

wrote:
You are right '\r\n' works great thank you!

Note that this wont work in the debug console. But, I am confused because /n has worked for me in Strings. Must be something with how Coppercube saves text files.


ishmaru
Guest
Quote
2019-02-11 22:57:45

Also, it's not working well on android either. Sometimes works, sometimes no text is displayed.


Zoo
Guest
Quote
2019-02-17 22:04:45

It wont work on android because android is a Linux based system... Those commands only work on windows based systems


ishmaru
Registered User
Quote
2019-02-25 01:47:26

hihisisy is a Spam Bot ^


peterpro
Guest
Quote
2019-07-31 19:29:41

It's not working on Android


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "?nternational" (you are not logged in)


Text:

 

  

Forum Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   





Software: Ambiera Light Forum. © 2008-2019 Nikolaus Gebhardt, Ambiera e.U.