Text Box

Catlike Coding’s Text Box 2
for advanced text layout in Unity

Want to do some serious text layout in Unity? Now you can! Mix custom styles and fonts. Write your own renderers. Create multi-column layouts. Flow text around custom shapes. Use nested clipping and scrolling. Support clickable text. And it renders fast, on mobiles, with dynamic text, while keeping memory clean.

Text Box 2 is currently in beta. New features are released regularly, but documentation is still sparse. Text Box 1, which still runs on Unity 3.5.7, is also included in the package.

Version 2 beta 3.2 is now available!

$45 on the Asset Store

Product Pag, Demos, and Docs

(Below is the introduction for Text Box 1, which works with Unity 3.5.7 and is included with Text Box 2 beta.)

Here’s a text box that is powerful, fast, efficient, and runs anywhere. With word wrapping, text justification, character modififcations, outlines, shadows, and other fancy effects. For when “just text” isn’t good enough and you want the ultimate text solution for Unity.

Features

What key features does the ultimate text box have? I say these:

  • Automatic word wrapping
  • Text justification
  • WYSIWYG editing
  • Color and placement modification
  • Excellent performance
  • Memory-friendly dynamic content
  • Clickable text
  • Fancy text effects
  • Bitmap font importer
  • Gradient tool
  • Documentation
  • Support

It renders text using imported bitmap fonts, which means you can include exactly those characters you want, packed as efficiently as possible. There are multiple free tools to do this with. All characters from the Basic Multilingual Plane are supported.

Screenshots

Here’s some screenshots. All text is rendered using distance maps, the effects are applied by modifiers and shaders.
(The images get scaled down a bit to fit the forum, open them in a new view to see them at full size)


vertical gradient plus outline, text justified and set to stay inside the box width


shadow added with a shader


marked text colored yellow with a modifier


wrapped around a cylinder with a modifier


text made vague at a distance with a shader

Those screenshots were all from editor mode scene view, by the way. Here’s one with the text selected.

And here’s the text component’s inspector.

You also get a gradient asset, for those extra special color transitions.


Demo Scene

Here’s the demo scene, running on an iPad.

Demo Video

Here’s a demonstration video that shows how to get a nice text box up and running.

Go grab it from the Asset Store!

Any idea of price? This looks like an absolutely solid text system that I can’t wait to use for my games.

Nice tool!
Does it support to display a text from a variable inside a script? for a high score?

Looks like a pretty useful and well made tool. Can’t wait to see what it will cost. But so far, nice work!

Yes looks very good. +1

no demo?

How do you render text? Does it support other languages?

@nickgravelyn @Chickenlord

As it stands now, the initial release version will be available for $45.

@Lars Steenhoff

It definitely supports variable content. It actually supports a very memory friendly method to do so, via a StringBuilder object. I have also included a utility class with useful methods for getting ints and floats into StringBuilder object without a hassle.

There’s a simple high score list example at the bottom of the text box component’s scripting documentation page.

@imtrobin

You were ahead of me! I just made the demo scene available as a webplayer.

@mente

Text is rendered by drawing a mesh full of sprites with character data from a bitmap font. The nice text effects are achieved by using distance maps and shaders. Text Box has its own font asset that imports BMFont-compatible bitmap fonts. There are multiple free tools for converting TrueType fonts to bitmap fonts, which allow you to fine-tune the characters to include. You can use my free Unity tool for generating distance maps.

Many modern languages are supported, the text box can handle all characters in the Basic Multilingual Plane. All you need is a font that includes the characters you want.

looks good. 2 questions

  1. How is performance, number of draw calls?

  2. Asian language support?

@imtrobin

  1. Performance is excellent! As fast or faster than Unity’s own TextMesh, while it does more. It’s one draw call per text box, ignoring Unity’s batching and such.

  2. Anything in the Basic Multilingual Plane is supported, though only left-to-right and rendered as-is, with kerning. So languages like Chinese and Japanese are no problem, but it won’t do any smart rendering of Arabic characters and such.


“Hello world” in multiple languages, according to Google Translate

An advantage of bitmap fonts is that you can prune characters. I used a TrueType font with thousands of chinese and japanese symbols, but only imported the few that were necessary to display “hello world” into Unity.

Edit: nm!

Not to criticize your pricing, but $95 for just a UI system? Considering that Unity already has a UI system and is available for free, $95 seems a little steep.

Of course, if “just a UI system” isn’t good enough, then $95 is a steal for the features your UI system has. Right?

If you want “just text”, Unity has that covered for free.

The price seems high to me as well … I would have thought something around $20. However, it’s your product so best of luck.

I’d certainly spend way waaaaaayyy more than 45 bucks in time to implement these. This came at a perfect time for me as I was just about to implement many of these features myself for my next game.

I’ll gladly pay the 45 bucks for this. It does not have good competition in the asset store that I know of, so it’s not fair to compare it’s price tag with that of UI systems, which currently are the assets that are competing the most.

Fair enough. I actually re-read what your product does. I completely missed the distance maps part. That’s actually pretty cool. I suggest you market it as the perfect solution for text decals. :slight_smile:

I made a short demonstration video that goes through all the steps necessary to get pretty text.

@petrucio

:slight_smile: That’s fortunate timing! The product is pending review and should be available in a few days.

@ArenMook

Thank you. I’ll keep marketing it as an all-purpose text box though. Lots of people looking for text don’t know what decals are, even if they’re using them.

Text Box is now available on the Asset Store!

Grab it for just $45!

Strangely, the initial release contained files that were outside the project and shouldn’t have been included. It also lost its screenshots. I worked with Unity to get an update on the store within an hour that resolved all this. Still, people managed to buy it during that time, so please fetch the product again if you’re one of them. I did use the opportunity to sneak in a tiny bug fix concerning prefabs.

Version 1.0.2 is in the pipeline. It will contain some WYSIWYG improvements and support for multi-object editing. You will also get a new text modifier that tweaks vertices instead of colors.

852670--31828--$text-cylinder-x.png 852670--31829--$text-cylinder-y.png
With minimum effort, you can wrap your text around a cylinder.

This package looks great only there is one feature that I can’t tell if it is available in any way or how hard it would be to implement. Can you easily detect which letter or word you are touching? Some sort of raycast to word would be ideal (for providing links, access to dictionaries, etcetera).

:slight_smile: That sure sounds like a useful feature! So I’ve included support for it in the upcoming version 1.0.2. If you add a mesh collider to the text object, it will work with ray casts and you can ask it to convert hit info into a character index.

As I currently seem unable to log into the package manager, I’m not sure how long you’ll have to wait before 1.0.2 becomes available. I hope it’ll be a few days at most.