[Solved]Adding a texture to a font

So this may be a more advanced topic covered later, but I would like to texture my font with a cool metallic texture. Can anyone help me with this? I’ve tried creating a material and adding the texture to it then applying it to the Title, but it just turns the title into solid black blocks.

To be more clear, I have a font called The League of Orbitron. Attached is a picture of the font with a texture on it. I want to take that texture and apply it to my font.

Hello King,

Well, I don’t know how to import it with the texture image itself, It usually comes with a texture that renders the text in the quality that it was supposed to show, for this you should set the Character mode to Dynamic under the text inspector.

You can add an image texture to any font by adding a material to it:

Import the font, and make sure the character mode is set to dynamic:

Import an image (Drag it to the project folder) and Create a new Material (Left Click on the asset folder > Create > Material) :

Drag the Image to the Emission and set the rendering mode to Fade under the Material inspector:

Drag the Material to the Text:

This is the way that I would do it, but there is probably better ways, lets see if some other users have a better solution

The only thing that you might be missing is changing the rendering mode to Fade or cutout instead of Opaque

@Joao_Dalvi Ok the texture is finally attached correctly. However, while it shows in Scene mode, it does not show in game mode:

1 Like

I had to switch from Screen Space - Overlay to Screen Space - Camera. I don’t know the implications of this change in the long run.

1 Like

You can also change the Screen Space to Camera and then set the Main Camera as the target camera in the canvas inspector

Got it. Thank you! How would I make the text change color for transitions? It doesn’t work anymore. This is getting more complicated than I intended lol. Maybe I won’t apply the texture to the button…

King, you could change the value using a script with the following code:

Material MaterialColor;
MaterialColor = GetComponent<Text> ().material;
MaterialColor.SetColor ("_EmissionColor", Color.black);

Although you would have to make a huge script changing the button color under the update with OnMouseDown() method in order to change the text color, which would be a huge amount of work. And still, the chances are that if you change the material color of the text, it will change the color of all buttons (since they would be using the same material)

Another way would be to import the font with the texture already applied to it (I don’t have a clue about how you could do it), it should change the color just like a button.

Although in my opinion the best option would be to create a Button UI element instead of just using the text as a button. You would be able to change the Button color on mouseover just like the following:


(the second image my pointer is within the button area)

You can also customize the button UI image. (for this method to work as intended, you have to place the text in front of the UI Button)

1 Like

Thank you!

1 Like

You are welcome, let me know if I can be of further help

Privacy & Terms