Forum rules - please read before posting.

How do you display different options for a Language "Cycle" menu using Unity UI?

For instance, when using Unity UI with AC, I have a cycle menu named "Language" in the game's options.
Clicking this "Language" button changes the game's language, but there's no way to tell which language is being selected when clicking on it.

I want it to show "Language: English" and on clicking, it should change to "Language: French". Currently it just stays at "Language" as that's what I've defined in the Unity UI text. How would one go about adding the ":English" or ":French" part to this? I can't see any inbuilt way to do this (Does AC usually just recognize the languages and do it automatically?)

I checked out the 3D demo, and it seems to have this functionality. But switching its menus to Unity UI didn't show anything different from what I've done. How do I go about this?

Thanks

Comments

  • Yes, the ": English" etc should be added automatially.

    Are you linking the Cycle element to a UI Dropdown or a Button?

    If using a Button, the text should update so long as your Button has a Text component either attached to itself or a child object.

    If you want to try debugging it, the internal recording of the Text component occurs in the MenuCycle.cs script's LoadUnityUI function, where the uiText variable is assigned.

  • edited May 2019

    The issue was that the Language button's text was using Text mesh pro. I did the integration and now it's working correctly. Thank you for the help as always!

  • edited May 2019

    I have another, slightly related question - Upon exporting to csv some lines have "[break]" written at the end. What does this do? Can I safely remove this so that translators don't end up translating "break"
    Treat carriage returns as separate lines is unchecked, not sure if that's related.

  • If you have a carriage return in your speech text, it'll be replaced with [break] when exporting - and vice-versa, instances of [break] will be converted into carriage returns when re-importing.

    These'll need to be retained if the carriage return is intended - i.e. to separate lines when displayed as speech. However, if it's placed at the end of the line (unintentionally), then you can remove this if you wish.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.