Text Printers

Text printers are actors used to present self-revealing text messages to the user.

Printers' behavior can be configured using Naninovel -> Configuration -> Printers context menu; for available options see configuration guide. The printers' resources manager can be accessed using Naninovel -> Resources -> Printers context menu.

In naninovel scripts, text printers are mostly controlled with @print and @printer commands:

; Will activate `Dialogue` printer
@printer Dialogue

; Will active `Fullscreen` printer
@printer Fullscreen

; Will print the infamous phrase using active printer
@print text:"Lorem ipsum dolor sit amet."

; The same as above, but using generic text statement
Lorem ipsum dolor sit amet.

; The same as above, but associated with character "Felix"
Felix: Lorem ipsum dolor sit amet.

Dialogue Printer

Dialogue printers present text inside windows with a flexible height. They initially take about a third of the screen size and will increase the height when the content requires more space. Dialogue printers also expose associated character name in a label above the text window.

Dialogue Printer

Fullscreen Printer

Fullscreen printers present text inside windows with a static size. They take most of the screen size and are indented for presenting large amounts of text.

Fullscreen Printer

Wide Printer

Wide printers are very like dialogue printers, except for some changes in the panel layout tailored for wide displays. Wide printers also support character avatars feature.

Wide Printer

Chat Printer

Chat printer presents text inside message bubbles framed in a window with vertically-scrollable content, resembling a mobile messager app. Instead of revealing the printed message character by character, it shows "author is typing" animation for the duration of the reveal effect and then instantly shows the printed message. Chat printer supports character avatars feature.

Chat Printer

Adding Custom Printers

You can customize the built-in text printers in any way you wish or create new printers from scratch. For example, let's customize the built-in dialogue printer.

All the built-in printer prefabs are stored inside Naninovel/Resources/Naninovel/TextPrinters folder. While you can directly edit the prefab and immediately get the result, consider duplicating it and adding as a separate printer to avoid issues when updating Naninovel package in the future.

Duplicate (Ctrl/Cmd+D) Dialogue.prefab and move it outside of the Naninovel package, e.g. to Assets/Printers folder.

Edit the prefab: change font, textures, add animations, etc.

Expose the prefab to engine resources using the printer's manager GUI, which can be accessed with Naninovel -> Resources -> Printers context menu. Add a new record using + (plus) button, enter actor ID (can differ from the prefab name) and double click the record to open actor settings. Drag-drop printer prefab to the Resource field.

You can now use the new text printer by activating it via @printer command and specifying actor ID you've set in the manager.

@printer MyNewPrinter

It's also possible to create a printer from scratch by manually implementing ITextPrinterActor interface. See the guide on custom actor implementations for more information.

Text Reveal Effect

By default, a gradient fade effect is applied when printing out the text messages. If, however, you prefer the more conventional "typewriter" style, you can disable the fade effect by disabling Slide Clip Rect and setting Reveal Fade Width property in Revealable Text component to zero. Revealable Text components are applied to the text objects in some of the built-in printers; eg, you can find it attached to Fullscreen/Content/Printer/Text gameobject of Naninovel/Resources/Naninovel/TextPrinters/Fullscreen printer prefab.

Text Reveal Sounds

For the built-in printers, that support revealing effect (currently, Dialogue, Fullscreen and Wide) you can optionally set SFX to be played when the characters are revealed.

Follow the "Adding Custom Printers" guide above to create a custom printer based on any of the built-in ones, then find Revealable Text Printer Panel component attached to the root object of the prefab and use Reveal Sfx property to set the SFX to be played when a character is revealed. The actual list of the available options is based on the audio resources you've added via the Naninovel -> Resources -> Audio menu.

You can also use Chars SFX list property to map multiple SFXs to specific characters. The following illustration represents setup, where "Keystroke2" SFX will be played for spaces, "Explosion" for characters D, d, F, 1, 4, 9, and *, no SFX will be played for % character and "Keystroke1" will be played for all the other characters.

Alternatively, you can set Message Sound in the character configuration menus to play character-specific sounds when the text is revealed while that character is the author of the message (no matter which text printer is printing that message). In case both Message Sound of the message's author and Reveal Sfx of the active printer are assigned, Message Sound will be played instead of the printer's default Reveal SFX. Chars SFX, when configured, will always be played, no matter if Message Sound of the author is specified or not.

The text reveal sounds are played very often (depending on the message reveal speed) and are clipped when same sound is played in consequence, so make sure the corresponding audio clips are very short and sharp (without any pause/silence at the beginning).

TextMesh Pro

Naninovel supports TextMesh Pro via a standalone extension package, that contains Fullscreen, Dialogue and Wide printers implemented with the TMPro UI text components.

First, download the latest version of the package using the link below: NaninovelTMPro.unitypackage.

Before importing the package, make sure you have TextMesh Pro installed in your Unity project. TextMesh Pro can be installed via package manager accessible via Window -> Package Manager menu.

Import the package and follow the above guide to add a new custom printer using one of the bundled TMPro printer prefabs (stored at NaninovelTMPro/Prefabs folder).

You can now select the added TMPro printers to route all the print commands to them using @printer command in naninovel scripts. In case you've named the printers the same as on the illustration above:

; Activate dialogue TMPro printer
@printer TMProDialogue
; Print text using the activated printer
Hello World!

When creating custom TextMesh Pro font assets, don't forget to apply Naninovel/NovelFontTMPro shader, otherwise the text reveal effect won't work.

Text Styles

Various text styles can be applied via rich text tags placed right inside the text or using @style command.

The default (built-in) text printers are based on Unity's text rendering system and support basic text styling like color, size, bold, italic, etc. Refer to guide on text tags for more info.

TextMesh Pro printers (bundled with the NaninovelTMPro.unitypackage) support a wide range of additional text tags. See the official documentation for more info.

Support for ruby (furigana) characters is additionally provided by the Naninovel's TextMesh Pro printers via custom <ruby> tag. Wrap the text above which the ruby characters should be placed with the ruby tag and specify the ruby text inside the tag, eg:

Lorem <ruby="VERY">ipsum</ruby> dolor sit amet. 

— "VERY" ruby text will appear right above "ipsum" word when the message is printed at runtime.

You can additionally control the size and vertical line offset of the ruby text by changing properties of RevealableTMProText component attached to the printer prefabs.

Below is a video demonstration of the ruby tags in action.