ClementSparrow / Pattern-Script

Open Source HTML5 Game Engine based on PuzzleScript
20 stars 2 forks source link

Allow line breaks in messages #42

Open ClementSparrow opened 2 years ago

ClementSparrow commented 2 years ago

Currently, if you want to make a message that is left-aligned rather than centered, or paragraphs in a message (and thus, lines that should stop at the end of the paragraph), or blank lines, it becomes a nightmare to find where to add spaces in the message so that the automatic centering function breaks the lines where you want. And some things are impossible without adding visible characters (e.g., a line break in the first line).

So I propose we can place manual line breaks in messages. The simplest way to do this would be to have a character that represents a line breaks and can be escaped, but it may break existing games. Other ways may be safer, but need to deal with the parser and I don't want to.

david-pfx commented 1 year ago

Dealing with the parser is right up my alley. How about this:

message This is a multi-line message
+ of exactly 4 lines
+
+ of which the 3rd is blank.

I don't think this is going to break any existing games.

ClementSparrow commented 1 year ago

Yeah, that would work. The spaces after a + should NOT be discarded, though.

david-pfx commented 1 year ago

I thought the idea was that any text would be trimmed and centered. Why would you retain spaces and then centre it off centre?