pseudo code....
message = "hello from me"
newmessage = ""
y = 0
***
search for next [space] in message
if there isnt one
word = message
message = ""
else
word = everything before space in message
remove word+[space] from message
endif
if fontwidth(newmessage+[space]+word) > xlimit
print newmessage at yth line
newmessage = word
add 1 line to y
else
add [space] + word to newmessage
endif
repeat *** until nothing in message
I think.
message = "hello from me"
newmessage = ""
y = 0
***
search for next [space] in message
if there isnt one
word = message
message = ""
else
word = everything before space in message
remove word+[space] from message
endif
if fontwidth(newmessage+[space]+word) > xlimit
print newmessage at yth line
newmessage = word
add 1 line to y
else
add [space] + word to newmessage
endif
repeat *** until nothing in message
I think.