Search Unity

Chinese IME into Unity

Discussion in 'Made With Unity' started by minevr, Apr 3, 2009.

  1. minevr

    minevr

    Joined:
    Mar 4, 2008
    Posts:
    1,018

    Attached Files:

  2. minevr

    minevr

    Joined:
    Mar 4, 2008
    Posts:
    1,018
    :D :D :D
    I am very excited!!
     

    Attached Files:

  3. ttt121

    ttt121

    Joined:
    Oct 20, 2008
    Posts:
    18
    Well Done!!


    By the way,the"自由"in the pic,is me :D
     
  4. dgdg69

    dgdg69

    Joined:
    Apr 3, 2009
    Posts:
    2
    :)
    Very interesting things
     

    Attached Files:

  5. minevr

    minevr

    Joined:
    Mar 4, 2008
    Posts:
    1,018
    :D
     

    Attached Files:

  6. twsmd2008

    twsmd2008

    Joined:
    Mar 28, 2009
    Posts:
    1
    You really did a good job!
    Great!
     
  7. rytis

    rytis

    Guest

    Joined:
    Jul 11, 2008
    Posts:
    138
    Awesome! How did you implement it? :)
     
  8. minevr

    minevr

    Joined:
    Mar 4, 2008
    Posts:
    1,018
  9. rytis

    rytis

    Guest

    Joined:
    Jul 11, 2008
    Posts:
    138
    Not much of a chinese reader, and translating is not very productive :) Any chance to get a brief description?
     
  10. minevr

    minevr

    Joined:
    Mar 4, 2008
    Posts:
    1,018
    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. public class test : MonoBehaviour {
    4. // Use this for initialization
    5. public GUISkin gskin;
    6. private string inputStr="";
    7. private Vector2 scrollPosition;
    8. private string result="";   //结果
    9. void Start () {
    10.   inputStr="直接输入中文";
    11. }
    12.  
    13. // Update is called once per frame
    14. void Update () {
    15. }
    16. void OnGUI()
    17. {
    18.  
    19.   GUI.skin=gskin;
    20.   inputStr=GUI.TextField(new Rect(200, 154, 200, 30), inputStr, 25);
    21.   GUI.Box(new Rect(200,50,200,100),"");
    22.   GUILayout.BeginArea(new Rect(200,50,200,100));
    23.   scrollPosition = GUILayout.BeginScrollView (scrollPosition);
    24.   string[] list=result.Split('*');
    25.   foreach (string entry in list)
    26.   {
    27.    GUILayout.BeginHorizontal();
    28.    GUILayout.Label(entry);
    29.    GUILayout.FlexibleSpace ();
    30.    GUILayout.EndHorizontal();
    31.   }
    32.   GUILayout.EndScrollView ();
    33.   GUILayout.EndArea();
    34.   if(Event.current.type == EventType.keyDown  Event.current.character == '\n'  inputStr.Length > 0)
    35.   {
    36.    result+=inputStr+"*";
    37.    inputStr = "";
    38.    scrollPosition.y = 1000000;
    39.   }
    40.  
    41. }
    42. }
     
  11. rytis

    rytis

    Guest

    Joined:
    Jul 11, 2008
    Posts:
    138
    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?
     
  12. minevr

    minevr

    Joined:
    Mar 4, 2008
    Posts:
    1,018
    Cut font:http://bbs.vrsh.cn/thread-1833-1-1.html :D
     
  13. minevr

    minevr

    Joined:
    Mar 4, 2008
    Posts:
    1,018
    Update
     

    Attached Files:

  14. english10

    english10

    Joined:
    Mar 16, 2009
    Posts:
    26
  15. nm8shun

    nm8shun

    Joined:
    Jul 14, 2007
    Posts:
    476
    Very cool stuff fellas.

    Hau(3) wan(2)!
     
  16. northman

    northman

    Joined:
    Feb 28, 2008
    Posts:
    144
    :eek:
    it's powerful. I like it.
     
  17. the_gnoblin

    the_gnoblin

    Joined:
    Jan 10, 2009
    Posts:
    722
    Thank you! :D
     
  18. rahuxx

    rahuxx

    Joined:
    May 8, 2009
    Posts:
    537
    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