-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lua Exporter: The backslash (\) gets doubled each time used in a string #933
Comments
Well, if you want your text to be "Hello \n World", then it is necessary to escape the Unfortunately, it is at the moment impossible to put a newline in a property in Tiled. The only way to achieve this is to edit the TMX file in a text editor. In this case, Tiled will export it to Lua as Eventually I want to add a text area for editing multiline properties to the properties editor. This is covered by issue #205. Until then, you could of course implement your own search-and-replace to turn "\n" into an actual newline character. |
Thats exactly what I want it to do.
This isn't true.When typing "Hello \n World" in tiled I get "Hello \n World" as output at the lua side. I don't need multiline support in Tiled. I just want to have the exact same line I typed exported to the lua file. Maybe I just don't get what you wrote there. Sorry then. |
That's because you're reading the Lua code. When you would
That would easily lead to invalid Lua code if you're not careful with what you type. Most notably, users would be struggling to insert any special character like Really, if you want a newline character in the string, you probably need multiline support in Tiled. |
Lua escape sequences get malformed when added into a string in tiled. for example this line:
"Hello \n World"
In the tmx file the string is saved as expected. However in the lua export it magically got two backslashs what causes that my text won't get printed properly.
The text was updated successfully, but these errors were encountered: