Can I control the Align in Dialogue Text with a script?

Posted: 11 Oct 2022 15:56
by booksuny

I want to change the dialouge alignment as I want during the conversation.
For example, if a character appears from the right, it aligns to the right, and if it appears from the bottom, it aligns to the bottom.

I looked up the manual, but I don't think this function is available, so I'm asking.

I tried to write a script in the form of approaching the existing Unity text, but it doesn't seem to work, so I want to know how.


Re: Can I control the Align in Dialogue Text with a script?

Posted: 11 Oct 2022 16:00
by idaot

You can use text tags or the text component's settings to change alignment (https://naninovel.com/guide/text-printe ... ext-styles) but to automate the process you'll like need to override/create your own printer. My suggestion is to listen to the On Author Changed changed event found in the printer and retrieving the actor's current position via ICharacterManager.


Re: Can I control the Align in Dialogue Text with a script?

Posted: 11 Oct 2022 19:40
by booksuny
idaot wrote: 11 Oct 2022 16:00

You can use text tags or the text component's settings to change alignment (https://naninovel.com/guide/text-printe ... ext-styles) but to automate the process you'll like need to override/create your own printer. My suggestion is to listen to the On Author Changed changed event found in the printer and retrieving the actor's current position via ICharacterManager.

Thank you for your reply.

I'm using Google Translator because I can't read English, so I'm asking you to check because there's a little bit of confusion in the answer.

Is it correct to search for the function "On Author Changed" and learn it?


Re: Can I control the Align in Dialogue Text with a script?

Posted: 12 Oct 2022 08:07
by idaot

Yes.


Re: Can I control the Align in Dialogue Text with a script?

Posted: 07 Nov 2022 11:40
by joung

Thanks idaot for the helpful link, I was looking for it too.