Array Editor: how to add manual line breaks?

0 favourites
  • 4 posts
From the Asset Store
solution for games like "fruit ninja" and drawing applications
  • I have plenty of long texts in json arrays. For some of the texts, I'd like to add a manual line break to make it more readable. For example, I have a text that says:

    "Game Over. Try again." and I'd like to change it to

    "Game Over.

    Try again."

    Pressing Enter in the array editor accepts the text, so I can't another line with that.

    Pressing Shift + Enter DOES create a new line, but it vanishes whan I click outside of the editor, or press enter to accept the change.

    Curiously, copy + pasting text from a Libre Office file creates line breaks and empty lines, even at places where I don't expect or want them, e.g. in front of the text, or between random words. So it looks like it is possible to add line breaks - I just don't get how I can control them.

    Can someone help me? Is it possible to control line breaks in the array editor?

  • I use a simple trick - put some character where you want to insert a line break, then replace it with newline in runtime.

    For example: Hello there,^general Kenobi!

    Set text to replace(array.at(index), "^", newline)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Interesting, I am gonna try this, thank you. Its a bummer that a trick is needed though.

  • dop2000 You are a wizard!

    This is useful. Thanks! :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)