I want to use a custom money symbol in my game, but I’m unsure how to go about displaying it in the UI.
I can only conceive of two ways to do this. One would be to create my own custom font where I replace the $ symbol with my custom symbol. But that’s something I don’t think I’m capable of, and I don’t think it could come cheap enough to pay someone to do.
The only other way I can think of is to display an original graphic in the screen, but this is only reasonable in a limited number of instances. I can easily put a symbol on the HUD next to a number. As long as I know exactly where the symbol needs to appear, this isn’t too hard.
But it would be really nice if there was some way I could tie it in with a regular piece of text. So… Is there?
Is there some way to make an icon be drawn in a regular text object?
I imagine this is something that could also be used to display console buttons, so it would be really handy is there is already an easy system for this.
First, use TextMeshPro instead of the legacy text renderer.
Then download a open source font that has all symbols you need, ex Nato Sans, and add it in you Asset folder.
Then you use the build-in font creator tool - Font Asset Creator
If you need to make your own font-file where you add extra symbols from a specific font file that you already own, note that if the font is not open sources with the correct licence, or if you have bought it, you’re not allowed to use something like FontForge to edit the original font-file as it will break the license. So make sure to read the license
Wow, that’s much more detailed than I expected; thank you!
There’s a few things I don’t get, but those are things I’ll have to go over when I actually start putting this together.
For now, I just want to confirm: you’re saying I can add custom images into my font in TextMeshPro that I can have appear like a regular text character, correct?
How does one make the custom symbol appear? Do I use a special code like in HTML like & or would I be replacing specific characters, like redrawing the $ symbol to look like my symbol?
This much I already know, but it definitely bears repeating.
Fonts have copyrights and licenses just like any other art!
Well not really. If the symbol is not in the charset of the font-face, you cant merge them together in the font asset creator. So you must choose a font that already has all symbols.
So if you wanna have a out-of-this-world/sci-fi currency symbol, this is not the solution for that. But TextMeshPro probably has a solution for that to. In the end you’re just creating a sprite-sheet with some symbols.
If they don’t have that option, you could modify the typefyce .ttf/.otf file you wanna use, add the special symbol by replacing another symbol using FontForge or any other program (not that that could be illegal depending on the license of the font). Ex say you wanna replace with ※, then you find the glypth in the font file, replace it with your ※ symbol, save the font-file, import it using TextMeshPro Asses Creator and then whenever you write $ it will display as ※.
Hi there! Your quest to use a custom money symbol in your game UI is indeed an interesting challenge. While creating a custom font might seem daunting, it could provide a seamless integration of your symbol into regular text. If you’re exploring a cost-effective option, consider searching for online font creation tools or platforms that offer customization features.