R
R
RandomProgrammer2021-10-05 22:57:54
Unity
RandomProgrammer, 2021-10-05 22:57:54

Overlaying text on a mesh?

!I searched for my problem on the Internet and did not find the solution I needed .

Problem: I have a mesh that is not flat. I need the text to be superimposed on this mesh (and not just be next to it), the text can be anything, I can't pre-write it in Photoshop and paste it as a texture. As I tried to do: select the material on which the text should be rendered, but I do not know how to do it. Maybe through TextMeshPro? But again, you need to specify the material on which it should be rendered.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nekit Medvedev, 2021-10-06
@RandomProgrammer

alternatively you can paint the texture
_texture=new Texture2D(x,y);
sprite=GetComponent().sprite;//
//Draw letters by font
_texture.Apply();
targetSprite= Sprite.Create(_texture, new Rect(0,0,width,height), new Vector2(0,0));
GetComponent().sprite=targetSprite;
I took from my code, you will have another component

G
GavriKos, 2021-10-05
@GavriKos

Maybe through TextMeshPro?

Yes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question