Forum rules - please read before posting.

Another problem with RTL languages

edited July 2017 in Technical Q&A
Hi,

When the length of a text is too big to fit within the subtitles menu box, the text is being split into two or more lines. So for example the following sentence: 
"I'm a piece of text too long to fit into a box"
Would be presented like this:
"I'm a piece of text too long to fit
into a box"
This is all good and well for LTR languages, where the left most part is the first portion of the text. However, in RTL ones, this kind of text wrapping leads to that the first part of the text (which is of course at the right most portion of the text) is pushed down to the second line of text. So in the case of the example given, it would look like:
"of text too long to fit into a box
I'm a piece"
(the example is in english, to hopefully be clearer, but this of course does not happen with english, but rather with RTL languages).
Is there any way to solve this?
Thanks!

Comments

  • I'd say this is one for Unity UI.  Unity's Text component can have inverted Line Spacing values, which cause overspilled text to go upward, instead of downward.

    A simple custom script can amend this value based on the game's current language, which would also be necessary to change the alignment to right-leaning.

    RTL scrolling will be included in v1.58, by the way.
  • Regarding v1.58, that's wonderful to hear. Is there en ETA for its release?

    Regarding the unity UI script - I have zero experience in scripting but I assume I can go ask in unity's forums?

    Any further nudge you (or anyone else here) can give me would be  very much appreciated:
    - Where do I insert this script
    - Do I need to create AC translation for it to work (even though it's not a translation, but rather the main language).
    - Will the scrolling fix in v1.58 provide an alternative solution to big chuncks of RTL text? or is there no escape from solving it using script?

    Thanks again!
  • I never have firm release dates, but I intend for it to be released this month.

    The update will also include the ability to set a game's original language as RTL - note that if you only make use of RTL language(s), then you do not need to do any scripting - just amend your UI components accordingly in the Inspector.

    Scripting is only necessary if you want to be able to amend these dynamically - is that the case?

    I'm not sure what you mean by the last question.
  • That is indeed the case. My main, and only, language is RTL.
    Not needing coding is great. But what do you mean by 'amending the UI components accordingly'?
    How, for example, do I amend the text wrapping problem described in the opening post of this thread?
    Thanks!
  • I mean that if you switch to Unity UI for your Menu's display, then it will then be rendered with Unity's own Text component - which allows for much greater contol over the Menu's appearance.

    This component has a "Line height" field which, when inverted, causes subsequent lines to appear above, not below.

    Each default Menu has an associated Unity UI prefab, activated by switching that Menu's Source field to Unity Ui Prefab.  Unity UI integration is covered in Section 11.3 of the Manual, as well as this tutorial.
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.