problem with InputField
- Behdadsoft
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
7 years 3 weeks ago #2598
by Behdadsoft
problem with InputField was created by Behdadsoft
Hi.
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.
how can do it?
Thanks.
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.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using I2.Loc;
public class Input_feild : MonoBehaviour
{
public InputField input;
void OnGUI()
{
input.text = LocalizationManager.ApplyRTLfix(input[0].text);
}
}
how can do it?
Thanks.
Please Log in or Create an account to join the conversation.
- Behdadsoft
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
7 years 3 weeks ago #2602
by Behdadsoft
Replied by Behdadsoft on topic problem with InputField
I want know I2 Localization can fix InputField text during typing?
Please Log in or Create an account to join the conversation.
7 years 2 weeks ago #2604
by Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
Replied by Frank on topic problem with InputField
Hi,
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,
Frank
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,
Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
To get the betas as soon as they are ready,
check this out
Please Log in or Create an account to join the conversation.
- Behdadsoft
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
7 years 2 weeks ago #2605
by Behdadsoft
Replied by Behdadsoft on topic problem with InputField
Hi.
Thanks for reply.
I found a free Persian package that can fix RTL text into InputField directly and work very well.
UPersian: Unity Game Engine RTL Support
Thanks for reply.
I found a free Persian package that can fix RTL text into InputField directly and work very well.
UPersian: Unity Game Engine RTL Support
Please Log in or Create an account to join the conversation.
Time to create page: 0.160 seconds