Step 3: Line Breaks
If you test the application, it should look like this:
The text is blitting correctly, however there is an ugly "AAAA" where our two line breaks should be. This is because Windows uses 2 characters to indicate a line break. Carriage return, commonly known as \r in programming, it makes it jump back to the beginning of the line and then the actual line break, which goes down one line, known as \n.
So the "AAAA" you are seeing is actually "\r\n\r\n". In MMF2, we can't directly test if a character is a \r or a \n because they are displayed as invisible characters. However, because \r and \n do not appear in CharSheet (because they cannot be directly written as a single character) it means that their numeric position will not be found with the Find function, and a value of -1 is returned.
In MMF2, if you change the animation frame value to -1 it is rounded up to 1 and frame number 1 is "A". This explains the "AAAA". So, to test for a line break, we test if the ID value of a Character object is -1.
- ID of
= -1
: Destroy
: Set X Position to X Margin( "
" )
: Set Y Position to Y( "
" )+20
: Add 1 to CurrentPosition

6