ID:269039
 
I've been looking for some libs with that would help me with this, but I was unable to find one. I want to be able to show text on screen like in Dragon Warrior Online so it shows stats. Hopefully, someone can supply me with one or help me develop one.
search Map Text and find Raekwons Text on Map lib
In response to Skye Reaver (#1)
Skye Reaver wrote:
search Map Text and find Raekwons Text on Map lib
Ewww...don't use that. It's poorly written...I WOULD release a demo on it, yet, the way I do it, it can be done much shorter and more efficient, so, meh. =/
In response to Hell Ramen (#2)
you could bug wizkidd0123 on it he has like a bunch of that done already.
You can do it yourself, really. Just loop through every character in a peice of text, create a new object, set it's icon_state to the letter (also set it's icon to a .dmi file with the alphabet in it(a-z)), then just add it to the screen with an x offset (if characters are small enough), and give it a y offset to place characters in different rows. Well, here's a basic way you can do it:

var
TEXT="Hi, I'm Crashed"
xoff
xpos
for(var/i=0,i<lentext(TEXT),i++)
if(xoff>=32)
xoff-=32
xpos++
var/obj/C=new
C.icon='Alphabet.dmi'
C.icon_state=copytext(TEXT,i,i+1)
C.screen_loc="[2+xpos]:[xoff],5"
src.client.screen+=C
xoff+=10 <-- this here really varies on the size of the characters.


This can be done a lot better, but it works (or so I think it does) and is a decent example on how it's done.
In response to Crashed (#4)
That is so long and inefficient. The next version of BYOND needs to have like a text_onscreen() verb or something.... I tried to make it so that all npc text appeared onscreen in a little box... @_@ HARD! I gave up and used pop-ups... =/
In response to Lorddonk (#5)
It's not very long, and yes it can be shortened (but for the example, I had to keep it long to make sense), but inefficient? Besides, how do you think a "text_onscreen()" would work? Pretty much the same way.
In response to Xooxer (#7)
In response to XxDohxX (#8)
I prefer to go with what I know. I'm sure DMIFonts is all great, but I know how sd_text works and have used it many times to great effect. Besides, Lummox has enough publicity. ;P

~X