copious use of chr(10). and, see this?
https://forum.thegamecreators.com/thread/227054.
and, see this if you want a little inline formatting to the text:
https://forum.thegamecreators.com/thread/227144
original:
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "NOT BBCode" )
SetWindowSize( 800,600, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 800,600) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
GLOBAL b as String = "[b]" : GLOBAL bb as String = "[/b]" : GLOBAL bFlag as Integer
`GLOBAL i as String = "[i]" : GLOBAL ii as String = "[/i]" : GLOBAL iFlag as Integer
`GLOBAL u as String = "[u]" : GLOBAL uu as String = "[/u]" : GLOBAL uFlag as Integer
GLOBAL c as String = "[c#" : GLOBAL cc as String = "[/c]" : GLOBAL cFlag as Integer
BBText = MakeBB("[b]This[/b] [c#FFFF00][b]This[/b] This [b][c#FF0000]This[/c][/b]",400,200,64,1)
do
If GetRawKeyState(27) then End `[ESC]
Sync()
loop
Function MakeBB(ThisString$,x#,y#,Size,Align)
ThisText = CreateText("") : SetTextSize(ThisText,Size)
SetTextAlignment(ThisText,Align) : SetTextPosition(ThisText,x#,y#) `Set Pos before Bold
ThisLength = LEN(ThisString$)
ThisChar = 1 `Strings Start @ 1, Chars @ 0
Repeat
This$ = MID(ThisString$,ThisChar,1)
Skip = 0
If MID(ThisString$,ThisChar, 3) = b
bFlag = 1
ThisChar = ThisChar + 2
Skip = 1
Endif
If MID(ThisString$,ThisChar,4) = bb
bFlag = 0
ThisChar = ThisChar + 3
Skip = 1
Endif
If MID(ThisString$,ThisChar,3) = c
COL$ = MID(ThisString$,ThisChar+3,6)
`Print(COL$) : Sync() : Sleep(3000)
ColR = VAL( MID(COL$,1,2) ,16)
ColG = VAL( MID(COL$,3,2) ,16)
ColB = VAL( MID(COL$,5,2) ,16)
cFlag = 1
ThisChar = ThisChar + 9
Skip = 1
Endif
If MID(ThisString$,ThisChar,4) = cc
cFlag = 0
ThisChar = ThisChar + 3
Skip = 1
Endif
If Skip = 0
New$ = New$ + This$
SetTextString(ThisText,New$)
Last = LEN(New$)-1
`If bFlag = 1 then SetTextCharBold(ThisText,Last,1) `SetTextString Breaks Bold
If cFlag = 1 then SetTextCharColor(ThisText,Last, ColR,ColG,ColB,255)
Endif
INC ThisChar
Until ThisChar > ThisLength
EndFunction ThisText