ID:263224
 
Code:
/*
I advise you don't worry about this. Worry about Misc.dm, Note: Do not edit this in anyway
if you use it in your game, give the credit that is needed, Thankyou and enjoy the demo

RaeKwon
*/

mob/proc
close_menu(){for(var/obj/text/O in client.screen)del O;for(var/obj/back/O in client.screen)del O}
TOSP(var/textonscreen){text1=list();for(var/a=1,a<=length(textonscreen),a++){text1+=copytext(textonscreen,a,a+1)}}
textonscreenbackground(var/XC1,YC1,XC2,YC2)
for(var/XC=XC1,XC<=XC2,XC++)
for(var/YC=YC1,YC<=YC2,YC++){var/obj/back/b=new(client);
if(XC==XC1)b.icon_state="l";if(XC==XC2)b.icon_state="r";if(YC==YC1)b.icon_state="b";
if(YC==YC2)b.icon_state="t";if(XC==XC1&&YC==YC1)b.icon_state="ll";
if(XC==XC2&&YC==YC2)b.icon_state="ur";if(XC==XC1&&YC==YC2)b.icon_state="ul";
if(XC==XC2&&YC==YC1)b.icon_state="lr";b.screen_loc="[XC],[YC]"}
textonscreenTEXT(var/XC1,XC2,YC1,YC2,T)
var{XC=XC1;YC=YC1}TOSP(T)
for(var/Y in text1){var/obj/text/C=new(client);
if(XC==round(XC)&&YC==round(YC)) C.screen_loc="[XC],[YC]";else if(XC!=round(XC)&&YC==round(YC))C.screen_loc="[XC-0.5]:16,[YC]";else if(XC==round(XC)&&YC!=round(YC))C.screen_loc="[XC],[YC-0.5]:+16";
else if(XC!=round(XC)&&YC!=round(YC))C.screen_loc="[XC-0.5]:16,[YC-0.5]:+16";C.icon_state="[Y]";
sleep(0.5) // Important. If you wish for the text to sleep leave it, otherwise remove sleep(1)!
XC+=0.5
if(XC==XC2)
XC=XC1;YC-=0.5
if(YC==YC2-0.5)break}
mob/var/text1
obj
back
icon='back.dmi'
layer=999
New(client/C)C.screen+=src
text
icon='text.dmi'
layer=999
New(client/C)C.screen+=src


Problem description:

That's right, it's RaeKwon's text demo.

I'm having trouble understanding it.

Can someone tell me how to 1) make the text spacing 10 pixels closer and 2) make the text move onto a new line if there isn't enough room at the end for a whole word?

Thanks in advance,

--Ray

EDIT: The view is "12x10" and 23 characters can fit on each line, if that helps.
Ditch that demo. It's junk that he based off of my code that I used to teach him way back when I was first learning years ago. Then he went and made it even worse by cramming everything onto a few lines with badly named functions.

Take a look at DMI fonts by LummoxJR, or Shadowdarke's library if you want to see two good ways to do map-text.
In response to Loduwijk
Thanks, Loduwijk. It works perfectly now.

--Ray