Well, maybe some more math crap needed, as I haven't tested this a whole lot. It is supposed to be a way to set top, bottom, left, and right margins, and work with various font sizes to put letters to the screen using either an overlay or direct graphics display. It wraps words and displays them in a graphics screen with a page border and boxes around each non-space letter. That means if you take this with you on your Blue Origin flight, it won't work once you leave the atmosphere. Sorry about that...
Input nothing at the first prompt to get the default text phrase. Input 1 at the two other prompts for normal text spacing or increase or decrease either, as desired. Esc to quit, or any key to run again.
IF text$
= "" THEN text$
= "I'd like to solve the puzzle, please!" spacerx = a
spacery = a
font
= _LOADFONT("lucon.ttf", 60, "monospace")
olay = -1
row = 1: col = 1: r1% = 255: r2% = 0: r3% = 0
ml = 2: mr = 2: mt = 1: mb = 1
y = row: x = col: j = 0
flag = 0: j = 0
k
= INSTR(i
, text$
+ " ", " ") - i
j = j + 1
CASE IS = maxcpl%
+ 1 ' Space in margin. flag = 1 ' Negate leading space on next print line.
CASE IS > maxcpl%
+ 1 ' Word is larger than page width. flag = -1
x = col: y = y + spacery: j = 0
IF flag
= 1 THEN skip
= 1 ' Negates one leading space. flag = 0: i = i - 1: row = row + 1
PSL y + mt, x + ml, t$, r1%, r2%, r3%
x = x + spacerx
skip = 0: j = 0
show_letters% = -1
SUB PSL
(y
, x
, t$
, r1%
, r2%
, r3%
)
SUB box
(y
, x
, r1%
, r2%
, r3%
)
Pete
@FellippeHeitor BTW - I had some weird results I noticed ONLY when I changed the code and did a recomplie/run with the IDE F5 key. Many times it would only display part of the default text! For example: I input nothing, 1 and 1 and it displayed only part of the default text. Then I pressed a key to rerun, same parameters, and it displayed the entire text, as expected. I'm using v2.0. Any thoughts? Can you reproduce it? I just did by loading the program, typing REM to line 3, and then F5 to compile and run. I then pressed Enter, 1 and Enter, 1 and Enter. It only printed to "I'd like to solve the puzzle," leaving out the please! Very impolite! You'd think I was running FB. :D Anyway, I then pressed a key, re-entered the same parameters, and on that an all other subsequent run loops, it worked fine.