Hello!
I would like to use one font for everything (Menu, hotspots, subtitles, etc ) except when I change my language to Korean or Japanese, then point have everything ( Menu, hotspots, subtitles, etc ) use that font? Is there a way to do it in code maybe?
Thanks.
P.S.
Sorry, should have been in different category.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
(Moved to Technical Q&A)
You can hook into the OnChangeLanguage event to update your Menus whenever the language has been changed.
This is most easily done when using Unity UI for your menus, since you can just go through all of the Text components present in your Canvas hieararchy. See this wiki page for a sample script:
https://adventure-creator.fandom.com/wiki/Per-language_Menus
AC menus would be a bit more complicated, since you'd have to iterate through each of a Menu's Elements and update their font property in turn. I'd recommend the use of Unity UI in any case, though, since it's better equipped to deal with dynamic resizing based on changing fonts.
That's what I was thinking of. I'm currently using AC menus, but I'm not sure how to get the list Menu items, then I would need to loop through all of the MenuElements of each Menu item to update the font.
Where do I look for that?
An AC menu equivalent would be along the lines of:
I'm assuming I would just create a GameObject and attach this to it? Seems pretty straight forward.
This is what I was looking for "PlayerMenus.GetMenus ()"
Yes, so long as it's present in the Hierarchy, it should work.
You were close.
Change the private void GetFont to private Font GetFont
Quite right.
If anyone finds this, and is looking for a solution that supports TextMeshPro, I have added a script to the same AC Wiki page. It's the second script and works exactly like the first script. It just uses TMP instead:
https://adventure-creator.fandom.com/wiki/Per-language_Menus