11/7/2023 0 Comments Pixel perfect fontSo the problem is to have a base number to calculate the size. The character size variable in the TextMesh it doesn't actually resize the font itself, bit it resize the meshes beign drawn, so you have to calculate on that one to make it display correctly.Īs you see pixel aspect remains unchanged but the meshes change in size. The relation on camera and textmesh is the uv of the planes where chars are displayed. Thanks for the tip, I was suspecting it was the font material trying to draw on top of everything giving problems. I tried to ask for an explanation on what cause this in this thread, so far no reply: No matter if you use the same material for the fonts, if a text mesh is sorted on a different sorting layer order it will generate another drawcall. Mind also that I don't use dynamic text so I don't need resizing and scaling during gameplay.Īlso a thing you may want to know when working with text meshes and sorting layers. Now you may notice some pixel beign jagged, thats because I'm not doing anything to compensate the half pixel offset, and the fonts amterial are forced to point filter at runtime. On the text mesh however I don't keep Character size at 1 but I shrink at 0.635 to compensate the space of the UV on the text mesh that should be there to shrink the letters to real 16 pixels even if a char is not 16 pixel tall. Mind that 64 is not my actual sprite pixel to units size, but a multiple of it. I use for my orthographicSize a simple calculation Screen.width / 64 / 2. I had a bit of a headache to achieve pixel perfect text meshes on my pixel art game.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |