Fount Change?

Announcements, support questions, and discussion for the Dialogue System.
midgear
Posts: 15
Joined: Sat Jan 17, 2015 1:50 pm

Fount Change?

Post by midgear »

I have two Characters talking, one of them is demon and I want to use a custom fount  when he talks. I looked in the manual and couldn't find anything that would let me do that. Is there some trick to change founts on the fly or am I out of luck?


User avatar
Tony Li
Posts: 20992
Joined: Thu Jul 18, 2013 1:27 pm

Fount Change?

Post by Tony Li »

Hi,



It's not difficult to do, but it'll require a couple lines of code. What GUI system are you using?
midgear
Posts: 15
Joined: Sat Jan 17, 2015 1:50 pm

Fount Change?

Post by midgear »

I'm using the "JRPG2 Dialogue UI" Prefab.
User avatar
Tony Li
Posts: 20992
Joined: Thu Jul 18, 2013 1:27 pm

Fount Change?

Post by Tony Li »

It was quicker to write the code than describe how to do it, so just import this package. It'll add a new folder named "Custom Actor GUIStyle"containing a new prefab, "Actor Style JRPG2 Dialogue UI". Assign this to your Dialogue Manager instead of the regular JRPG2. (There's a test scene if you want to see it in action. Play the scene and run up to Private Hart. His text will be in a strange red font.)



If you inspect the prefab, you'll see that it has a new section, "Actor Styles". Add as many entries as you want. In each entry, specify the actor's name (e.g., your demon) and GUI Style to use. You need to define this as a custom GUI Style in the GUI Skin "Custom JRPG2 Dialogue GUI Skin" that's in the same folder.
midgear
Posts: 15
Joined: Sat Jan 17, 2015 1:50 pm

Fount Change?

Post by midgear »

There is an odd thing going on, the first time I talk to a character This Happens, but if I talk to them again it's normal.
User avatar
Tony Li
Posts: 20992
Joined: Thu Jul 18, 2013 1:27 pm

Fount Change?

Post by Tony Li »

Would you please post screenshots of the expanded dialogue UI the Hierarchy view and the UnityDialogueUI script in the Inspector view?
midgear
Posts: 15
Joined: Sat Jan 17, 2015 1:50 pm

Fount Change?

Post by midgear »

Okay:



dialogue UI and the Hierarchy



UnityDialogueUI
User avatar
Tony Li
Posts: 20992
Joined: Thu Jul 18, 2013 1:27 pm

Fount Change?

Post by Tony Li »

Could you please drag the "Actor Style JRPG2 Dialogue UI" prefab into a temporary scene, fully expand it in the Hierarchy, and post a screenshot of Hierarchy view?



Or, if you prefer, email the UI to tony (at) pixelcrushers.com and I'll check it out in Unity. Right-click on the "Custom Actor GUIStyle" folder in the Project view and select "Export package...". Then untick "Include dependencies" and click the Export... button.
midgear
Posts: 15
Joined: Sat Jan 17, 2015 1:50 pm

Fount Change?

Post by midgear »

Here you go
User avatar
Tony Li
Posts: 20992
Joined: Thu Jul 18, 2013 1:27 pm

Fount Change?

Post by Tony Li »

Thanks! I'll look into this and get back to you with an answer as soon as I can. (I'm out of the office at the moment.)
Post Reply