Unity-UI-Extensions.GitHub.io

TextPic

Inline images and hyperlinks for text


Contents

1 Overview

2 Properties

3 Methods

4 Usage

5 Video Demo

6 See also

7 Credits and Donation

8 External links


Overview

Provides a html interpreter to add inline images in Text. HTML code is similar to that used for Unity’s native Rich Text HTML


Properties

The properties of the TextPic control are as follows:

Property Description  
Image Offset Global Image offset  
Image Scaling Factor Global scaling factor for all images (they default to match the font size)  
Hyperlink Color Override the default color for Hyperlinks  
Icon List List of icon replacements and their lookup text  
  Name The name of the image, used as the replacement string in the text
  Sprite The sprite to replace text with in the text
  Offset individual offset (as opposed to the Global Image Offset) for this sprite
  Scale individual scale (as opposed to the Global Image Scale Factor) for this sprite

Inherited from Text


Usage

Add TextPic component instead of the standard Text control and decorate with Rich Text HTML, for example: Click Me

It can also place Images within blocks of Text by adding Icons to the Icon List with a Name, then instances of that name will be replaced with that Image (careful what name you use :D)

Simply add a new TextPic to the scene using “UI / Extensions / TextPic” in the Editor “GameObject” menu.

It is also available as a Game Component menu in “UI / Extensions / TextPic”. You have to remove any existing Text components first, else Unity will warn you.

Additionally, if you want configure hyperlink highlighting colours, simply add a “Selectable” component to the same GameObject as the TextPic control and configure it.

A Note on Buttons If the TextPic is added as a child of a Button you cannot use the hyperlinks feature of this control, it is purely decorative allowing the text and image replacement. The TextPic control will add a CanvasGroup control to the TextPic to enable click-through to the button.


Video Demo

Click to play

TextPicDemo


See also

N/A


Credits and Donation