Author Topic: i have a problem with UIInput about chinese..  (Read 1785 times)

woshihuo12

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 17
    • View Profile
i have a problem with UIInput about chinese..
« on: August 28, 2015, 10:25:55 PM »
my game use chinese ttf font. So at IOS, if player can input the ios's expression, so the UILabel will have some problem..
so i want limit the ios's expression, let player can't input the expression.
how can i get that?

very thanks............

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: i have a problem with UIInput about chinese..
« Reply #1 on: August 30, 2015, 02:47:05 PM »
You'll need to create your own UIInput.onValidate function to reject such characters.

woshihuo12

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 17
    • View Profile
Re: i have a problem with UIInput about chinese..
« Reply #2 on: August 30, 2015, 09:38:48 PM »
i don't the ios expression's code. so i write like this:

    private char OnInputValidata(string text, int pos, char ch)
    {
        if (ch >= 0x0000 && ch <= 0xFFEF) return ch;
        return (char)0;
    }