Pixel-Perfect Dynamic Text for Unity® (click to go to Asset Store) |
Have you ever been frustrated in Unity when working with text?
(e.g. with GUIText or TextMesh, or with some other product)
If your answer is YES, please read on.
THIS MIGHT JUST BE WHAT YOU'VE BEEN LOOKING FOR...
BUY HERE:
|
TL;DR — Pixel-Perfect Dynamic Text for Unity®! A component for displaying pixel-perfect camera-facing text.
Size & position are defined in world units. Sharp like built-in GUIText, but part of the scene like TextMesh.
This asset has its own niche:
|
Hint: Test changing window size and shape to see how text adjusts.
Click to launch interactive demo
(opens a new window) |
||
Note: Your browser needs to support WebGL to run the interactive demo. |
||
You can also view presentation of the demo in YouTube: |
Download the demo version as .unitypackage-file:
For Unity 4.x (at least Unity 4.2.2)
For Unity 5.x and all newer versions
Some warnings are shown with Unity 2018/2019/2020, as this Lorem Ipsum
demo version is not fully up-to-date with the sold package.
You can freely download the "Lorem Ipsum"-demo version for the purpose
of evaluating of Pixel-Perfect Dynamic Text component before purchasing.
In the demo version your own text is not shown, but instead replaced
with characters from the well known lorem ipsum text.
-
Some common issues when you work with text in game engines.
What can happen if you design for small screen (lo-res phone) first and then move over to larger screen (hi-res/hi-dpi desktop or tablet).
Starting point: For example, handcrafted layout for LO-RES phone. |
→ |
If you worked with absolute pixel sizes... The same pixels represent only a tiny portion of the larger screen and text is illegible. |
Or if you scaled up sizes and positions, but your font/images are too small bitmaps... Up-scaled image looks fuzzy and out of focus. |
→ |
What you want.. Resolution independent sizes and positions with text in the correct size in any resolution. |
What can happen if you design for large screens (hi-res/hi-dpi desktop or tablet) first and then move over to small screen (hi-dpi/lo-dpi phone).
Starting point: For example, handcrafted layout for HI-RES tablet or desktop. |
→ |
If you worked with absolute sizes... |
→ |
What you want.. Resolution independent sizes and positions with text in the correct size in any resolution. |
||
On HI-RES/HI-DPI phone content might almost fit: |
On LO-RES phone you'd get a tiny cropped area: |
Most of the listed features are demonstrated in the Interactive Demo (Unity Webplayer).
Text size is proportional to world units, and not dependent on screen size in pixels or dpi resolution.
For maximum sharpness, pixel size for text font rendering is dynamically selected to be the nearest matching size for text world unit size.
Pixel-Perfect Dynamic Text component also works with both orthogonal and perspective cameras.
You can choose if text is pixel snapped to keep it sharp when it moves on screen.
The Pixel-Perfect Dynamic Text component uses Unity's internal font renderer and atlasing.
Text can be aligned and anchored, similar to how Unity's built-in Text Mesh (3D Text) works.
You can ask for font metrics and use tabs for alignment.
The code contains many small tweaks to make it better.
No native code & small footprint.
Pixel-Perfect Dynamic Text works also with the new Unity 2D.
|
BUY HERE:
|
As usual, there are some trade-offs and caveats, and this is not an exception. Exact font metrics and glyph sizes vary a little bit when the font's actual pixel size is adjusted to the best match.
This is not a good choice when combined with a camera moving and rotating freely in 3D.
This is not a solution for all your UI needs.
No support for special effects like gradients, drop shadows or outline. (For now.)
|
If you're still wondering about something... or if you bought the Pixel-Perfect Dynamic Text and have an issue! (oh no)
But there's GUI Text, and it's not blurry or jaggy like in the examples. Why isn't it enough?
Why does my text look garbled?
I can't see text, what's wrong?
Why is the text sometimes blurry in the editor Scene view?
Why is this particular text blurry or jaggy in the game view?
I have some of my own custom UI movement/alignment code. Pixel snapping "fights" with it, moving each frame. How can I fix this?
Is there garbage collector (GC) problems?
What if I have performance problems?
As mentioned and shown in the interactive demo, it is not a good idea to have a screen with a camera rotating in 3D (see screen 8/10). Also it's not a good idea to constantly adjust size of a text in 2D either (see screen 5/10). That is, if the final text size on screen changes constantly due to 3D rotation or changing distance to camera. This will force Unity to flush and re-create the font atlas often. You can try to alleviate the problem by lowering the Max Font Px Size of DynamicText objects. However, in this case the text will appear blurry if it gets close to camera. This is one of the cases where you still might want to use the standard Text Mesh instead. If you need text in varying 3D angles which is also sharp when close to camera, then you should consider using one of the font packages which use distance field based font rendering. Note that those typically don't support dynamic fonts but use bitmapped pre-processed fonts instead, and they will require use of a custom heavy-weight shader, so what they're good at comes with their own set of limitations. If you know you need such a thing, here's links to some assets you might want to check out: Text Mesh Pro, Text Box. (note: we haven't tried these, so we don't know how good they are in practice)
How to fix this error message: No camera - can't generate mesh?
Does Pixel-Perfect Dynamic Text work with third party GUI packages like NGUI or Daikon Forge?
Does Pixel-Perfect Dynamic Text work with the new uGUI introduced in Unity 4.6?
I like the interactive demo, does it come with the asset package?
Can I try it before buying?
This is just like basic text should work!
|
// 2019-11-16, 1.2.4 - For Unity 2019.3+: Support for Enter Play Mode without Domain/Scene Reload. Removed GUILayer components to fix a warning. // 2019-04-16, 1.2.3 - Minor changes to fix Unity 2018.3 & Unity 2019.1 compatibility. // 2018-04-22, 1.2.2 - Minor fix for latest Unity 2017 & 2018 deprecation warnings. // 2017-05-06, 1.2.1 - Fixed issues related to text reverting when enabling&disabling. Tested Unity 2017 compatibility. // 2017-04-06, 1.2.0 - Fix for combination of DirectX9 and Unity versions 5.5 or newer. // 2015-08-11, 1.1.0 - Support for Unity 5 added. // 2015-02-17, 1.0.6 - Modified initialization to prevent doing it many times. Fixed a mesh memory leak. Fixed error case when Camera rect size is zero (can occur momentarily when starting Unity with autoloaded scene). Don't snap if transform lossyScale (XY) is zero. Added autoFaceCam checkbox which keeps text auto-oriented text towards given camera (like a billboard). Preliminary support for Unity 5 (compatibility for auto-upgrading dll). // 2014-09-23, 1.0.5 - Fix: In some cases SetText didn't work properly when called from Start(). Added automatic fallback to smaller font pixel sizes in case of font atlas rebuild loop (due to low memory or using too large text). Can suppress debug logging by setting dt.suppressDebugLogs=true from script code. // 2014-08-05, 1.0.4 - Added new feature: Letter Spacing (relative to selected text size). Fix: GetText returned empty string for game objects which were disabled when loading the scene (and had a DT component). This resulted in custom inspector clearing text in editor when viewing such objects. // 2014-07-04, 1.0.3 - Overall better performance and robustness. Fixed problem when internal sampling setting might be out of sync until toggling "Use Direct3D 11" in Player Settings. Metrics are now updated when switching font (fixes incorrect change in position). New "Auto Set Font Material" checkbox to control overwriting renderer.sharedMaterial. Added example of how to dynamically create DT prefabs aligned after each other. Default font is now automatically set when creating a new dynamic text object from code and leaving font as null (worked previously only in editor like this). Added custom inspector which indicates more clearly if camera or font reference is missing. Fix for changing text from script code in Start(). Removed need for deferred mesh generation (must have proper camera & font). Direct text string access replaced with SetText and GetText methods. Fixes for Windows Store and Windows Phone 8 support. // 2014-03-09, 1.0.2 - Added support for using a StringBuilder (textSB field). // 2014-03-04, 1.0.1 - Fixed an unnecessary allocation when reusing mesh arrays. // 2014-02-16, 1.0.0 - Initial version. |
BUY HERE:
|
TL;DR — Get pixel-perfect fonts for Unity® with Pixel-Perfect Dynamic Text.
It is a component for displaying pixel-perfect camera-facing text.
Size & position are defined in world units. Sharp like built-in GUIText, but part of the scene like TextMesh.
Did you like how Pixel-Perfect Dynamic Text is built?
—
Also from Strobotnik for Unity®:
Klattersynth TTS (NEW!)
Google Universal Analytics for Unity®
Internet Reachability Verifier
Strobotnik is a member of the Unity Affiliate Program.