Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Feature requests and bug reports
Line breaks with /n

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


bracer
Registered User
Quote
2020-06-25 16:21:55

Wait...there is no universal newline ?

In ActionScript, it's "Hello" + newline + "World", works across ALL platforms.


Create reply:


Posted by: (you are not logged in)


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


Text:

 

  

Possible 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


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact