We have figured out a way to implement chinese IME into Unity and it works so perfectly. Input Test:http://test.vrsh.cn/hello.html Chat Test:http://test.vrsh.cn/chatok.html It is free
Not much of a chinese reader, and translating is not very productive Any chance to get a brief description?
Code (csharp): using UnityEngine; using System.Collections; public class test : MonoBehaviour { // Use this for initialization public GUISkin gskin; private string inputStr=""; private Vector2 scrollPosition; private string result=""; //结果 void Start () { inputStr="直接输入中文"; } // Update is called once per frame void Update () { } void OnGUI() { GUI.skin=gskin; inputStr=GUI.TextField(new Rect(200, 154, 200, 30), inputStr, 25); GUI.Box(new Rect(200,50,200,100),""); GUILayout.BeginArea(new Rect(200,50,200,100)); scrollPosition = GUILayout.BeginScrollView (scrollPosition); string[] list=result.Split('*'); foreach (string entry in list) { GUILayout.BeginHorizontal(); GUILayout.Label(entry); GUILayout.FlexibleSpace (); GUILayout.EndHorizontal(); } GUILayout.EndScrollView (); GUILayout.EndArea(); if(Event.current.type == EventType.keyDown Event.current.character == '\n' inputStr.Length > 0) { result+=inputStr+"*"; inputStr = ""; scrollPosition.y = 1000000; } } }
Thanks! Cool, but in this case you still need to bundle a huge texture with chinese symbols for a font? Or do you do something else?
Hi there, if i want to use Arabic fonts, what change can be done in the script. Will i need some different character in Arabic format, thanks