Hello Guest

Author Topic: font resolution on game view  (Read 4664 times)

atmuc

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 35
    • View Profile
font resolution on game view
« on: January 18, 2013, 12:18:22 pm »
i use 2dtk camera and font. if game view is 1:1 my font look great. when i shrink game view everythink scale down. my text mesh does not look nice. i can see pixels. it is like it loose antialiasing. when i use the same font with ngui it looks nice at the same game window. what can i do to have a nice scaled meshtext on game view? it looks nice on scene view.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: font resolution on game view
« Reply #1 on: January 18, 2013, 12:23:03 pm »
You can enable mipmaps and set the texture to bilinear filtering if you want. The quality will be better when scaled down but you are likely to get artefacts - it might not be noticeable in a lot of cases, but it is definitely there. Alternatively you can use platform specific sprite collections - they will let you create different fonts for different resolutions. This is probably the most ideal case.

atmuc

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: font resolution on game view
« Reply #2 on: January 18, 2013, 01:26:13 pm »
thanks. bilinear solved my problem. i also noticed that NGUI uses trilinear :-) your gradient feature is great, both 2 colors and gradient texture like a library.

it will be great if you add shadow and outline effect to meshtext.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: font resolution on game view
« Reply #3 on: January 18, 2013, 02:40:13 pm »
Outline using overlapped sprites is really inefficient. Shadows - maybe, as a separate sample. I really try very hard to avoid adding features which are easily "abused" - those two mentioned earlier are really easy to abuse, using it for a score counter or timer which changes every frame is incredibly inefficient and will cause huge stalls.

Having said that though, there is a way to do shadows far more efficiently than having a black tinted duplicate, but I haven't had the time to implement it. I'll have some time to re-evaluate priorities after 1.90

atmuc

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: font resolution on game view
« Reply #4 on: January 18, 2013, 03:03:21 pm »
i added outline to font texture on photoshop. it worked with 2dtk gradient. font color is white, outline color is black. i think it cannot work with all color combinations, but this is enough for me. i would be very happy if there was a filter for bevel, outline, shadow on font generation process at 2dtk. now i do this job manually on photoshop. for the same font and different fx i have separate font bitmaps. it is better to have a source bitmap and design time generated atlasses. i know it is not to find the source code of this filters :-)