newline characters (\n \r) not being respected with OpenFL flash.text.TextField on JS target

StackOverflow https://stackoverflow.com/questions/23401536

  •  13-07-2023
  •  | 
  •  

문제

If I create a flash.text.TextField using OpenFL for a JS target, none of my newline characters are showing up. The textfield instead has one long string on a single line.

I've tried changing .wordWrap and .multiline but they do nothing to change this behavior.

haxe 3.1.3 openfl-html5 1.4.2

도움이 되었습니까?

해결책

Here is the file respoinsible for this behaviour. There is no handling of multiline property implemented currently, and no "\n" handling also. So your only options would be to either transform the texts yourself, or implement that handling(and probably file a pull request to also help others).

Talking about "\r", I don't think it would or even should be implemented, because runtime system isn't the place to handle incorrect encodings.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top