ID:272594
Oct 10 2008, 3:27 pm
|
|
So I've seen a few games that actually take a variable of text such as your name or a guild you're in, turns it into an icon, and places it on your guy as an overlay. I'm curious as to how such a thing is done.
|
In response to Jon88
|
|
I guess I'll check out that library then, thank you. If anyone else has any suggestions/tips/how-tos that'd be great as well.
|
In response to Demon Wrath4
|
|
I know it's not exactly legal to double post, but I can't make heads or tail of this library. It's over my head, I'm afraid. It'd be great if someone else would be able to offer some advice.
|
In response to Demon Wrath4
|
|
Did you take a look at the documentation link from the hub page? It links you to a reference and a few useful examples: http://lummoxjr.byondhome.com/byond/dmifonts.html
|
In response to Jon88
|
|
Stupid computer saving the library wherever it wants. I gave up because I couldn't find that DmiFonts application he said he included. I guess I'll try a little more before I give up again.
|
In response to Demon Wrath4
|
|
Okay, this seems like a gigantic amount of code just to display a single name above a mob or whatever this is used for. There must be a simpler way to do this.
|
In response to Demon Wrath4
|
|
Well, if you want to do it fully, it's not a simple operation: you're basically trying to take letters and convert them into pixels which are then stamped on a brand new icon to be displayed. Constructing all the needed icons would take a lot of time and effort.
However, if you're willing to settle for an easier compromise, you can always represent one letter per icon. Then you'd basically run through a string with code that looks something like: var/list/listOfIconsToReturn listOfIconsToReturn = new/list() for (var/thisLetter in textStringPassed) switch (thisLetter) if ("A") listOfIconsToReturn.Add(icon('myIconImageFile.dmi',"A")) if ("B") listOfIconsToReturn.Add(icon('myIconImageFile.dmi',"B")) // and so on return listOfIconsToReturn Of course, that would be pretty time intensive and the messages you want to display via icons would take up massive amounts of the screen. It's enough of a hassle that I prefer to keep my text in text form and display it using a 4X Skin element or something. This is just one way in which people could design around it, and I think that designing around it is a better solution in this case. |
In response to Demon Wrath4
|
|
Demon Wrath4 wrote:
Okay, this seems like a gigantic amount of code just to display a single name above a mob or whatever this is used for. There must be a simpler way to do this. Under the 'Name Labels' section of the documentation is a bit of example code that does exactly what you want. You can take the code from that section and modify it as necessary, say to add colour to the names. |
He's also working on a new (and unfortunately at least partly incompatible) version of the library that will use some of 4.0's features.