I want when i try to write my Arabic text into InputField in game mode, I2 Localization fix it to correct text. but when i use below code it don't work and only show one character in InputField.
public class Input_feild : MonoBehaviour
public InputField input;
input.text = LocalizationManager.ApplyRTLfix(input.text);
how can do it?
The administrator has disabled public write access.
problem with InputField
2 months 2 weeks ago #2602
Sorry for the delay in answering, this last days I have been traveling and unable to connect as often as I would have liked.
Unfortunately, the code to fix the InputFields is a bit more complicated:
- FixRTL can introduce/remove characters, so the cursor position needs to be adjusted accordingly.
- RTL is written from right to left, so the text needs to be reversed and cursor movement should be reversed as well.
- There is no callback in the InputField happening between the OnValueChanged and when the text is set in the TextComponent, (even the password masking happens in the same method), so the code needs to delay changing the text until after the InputField finishes updating its values.
I started doing some tests on making a component to fix InputFields when the current language is RTL. Will let you know as soon as its functional enough.
Hope that helps,
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!