Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - woshihuo12

Pages: [1] 2
1
NGUI 3 Support / Re: i have a problem with UIInput about chinese..
« 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;
    }

2
NGUI 3 Support / 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............

3
can someone help me??

4
when i use UILabel with "Resize Height", i want add some space in first row like this
""""""""""""""""""""""""""""""""
"    aaaaaaaaaaaaaaaaaaaaa
"bbbbbbbbbbbbbbbbbbbbbbb
"    cccccccccccccccccccccccc
"dddddddddddddddddddddd
""""""""""""""""""""""""""""""""
so i add some spaces befroe "aaaaaaaaa", but the first line take some new lines while not make some spaces before...
like this:
'''''''''''''''''''''''''''''''''''''''''''''''''''
"
"
"aaaaaaaaaaaaaaaaaaa
"bbbbbbbbbbbbbbbbbb
"    ccccccccccccccccccc
"dddddddddddddddddd
"""""""""""""""""""""""""""""""

5
NGUI 3 Support / Re: I meet a bug with UIScrollView.
« on: November 14, 2014, 06:17:10 AM »
thanks!!
can this changed in next ngui version?

6
NGUI 3 Support / Re: I meet a bug with UIScrollView.
« on: November 14, 2014, 01:33:18 AM »
someone can help me?

7
NGUI 3 Support / I meet a bug with UIScrollView.
« on: November 13, 2014, 02:07:32 AM »
when i add UIScrollView use code like this:
  1.   mScrollView = mPanel.gameObject.AddComponent<UICustomScrollView>();
  2.            mScrollView.movement = UIScrollView.Movement.Vertical;
  3.            mScrollView.verticalScrollBar = scrollBar;
  4.  

i notice that in UIScrollView , when mPanel.gameObject.AddComponent<UICustomScrollView>() execute:
  1.         void OnEnable ()
  2.         {
  3.                 list.Add(this);
  4.  
  5.                 if (Application.isPlaying)
  6.                 {
  7.                         if (horizontalScrollBar != null)
  8.                         {
  9.                                 EventDelegate.Add(horizontalScrollBar.onChange, OnScrollBar);
  10.                                 horizontalScrollBar.alpha = ((showScrollBars == ShowCondition.Always) || shouldMoveHorizontally) ? 1f : 0f;
  11.                         }
  12.  
  13.                         if (verticalScrollBar != null)
  14.                         {
  15.                                 EventDelegate.Add(verticalScrollBar.onChange, OnScrollBar);
  16.                                 verticalScrollBar.alpha = ((showScrollBars == ShowCondition.Always) || shouldMoveVertically) ? 1f : 0f;
  17.                         }
  18.                 }
  19.         }

but when this the verticalScrollBar is null...

so i make a trick like this:
  1.         mScrollView = mPanel.gameObject.AddComponent<UICustomScrollView>();
  2.             mScrollView.movement = UIScrollView.Movement.Vertical;
  3.             mScrollView.verticalScrollBar = scrollBar;
  4.             [b]mScrollView.enabled = false;
  5.             mScrollView.enabled = true;[/b]
  6.  

so this a bug? can i have some help ??
very thanks...

8
NGUI 3 Support / I meet a bug with UIScrollBar
« on: September 17, 2014, 11:24:25 PM »
bagPanel (panel uiscrollview)
  |-------bagContents ( UITable)
                |----------------bagItem
                |----------------bagItem
                |----------------bagItem

i set bagPanel's uiscrollview's Scroll Bars show condition to "OnlyIfNeeded"...
and i add some bagItems use  StartCoroutine(InitBagItems());
public IEnumerator InitBagItems()
{       
...
                AddRecordItem();
...
}

i notice that i have many items and the scroll bar shows, but i can't drag the scroll bar, because it's boxcollider is disabled..
so can i have some helps???
thanks................

9
NGUI 3 Support / i meet a bug with UIButtonColor.
« on: September 01, 2014, 03:04:50 AM »
Button (UISprite) (UIButton) (UIButtonColor)
   |- ButtonLabel (UILabel)

i use UIButton control "Button"'s color and i use UIButtonColor control "ButtonLabel"'s color.
when i set button disabled, the "Button"'s color changed, but the "ButtonLabel"'s color not changed..

when i change UIButtonColor with UIButton, the "Button" and "ButtonLabel" 's color can changed very well....
so ,this is a bug?
and how can i fix this?

10
NGUI 3 Support / ngui3.7.0 unity4.3.4 empty project, meet error..
« on: August 19, 2014, 08:36:05 PM »
Assets/NGUI/Scripts/UI/UICamera.cs(442,46): error CS1061: Type `UnityEngine.GameObject' does not contain a definition for `GetComponentInParent' and no extension method `GetComponentInParent' of type `UnityEngine.GameObject' could be found (are you missing a using directive or an assembly reference?)

the newest ngui can't support unity4.3.4?
why?
and how can i know witch new version ngui can support unity4.3.4?

11
NGUI 3 Support / UIinput i meet an error..
« on: August 12, 2014, 08:04:06 AM »
ArgumentOutOfRangeException: startIndex + length > this.length
Parameter name: length
System.String.Substring (Int32 startIndex, Int32 length) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System/String.cs:356)
UIInput.GetLeftText () (at Assets/NGUI/Scripts/UI/UIInput.cs:987)
UIInput.Insert (System.String text) (at Assets/NGUI/Scripts/UI/UIInput.cs:940)
UIInput.Update () (at Assets/NGUI/Scripts/UI/UIInput.cs:640)

ArgumentOutOfRangeException: startIndex + length > this.length
Parameter name: length
System.String.Substring (Int32 startIndex, Int32 length) (at /Users/builduser/buildslave/monoAndRuntimeClassLibs/build/mcs/class/corlib/System/String.cs:356)
UIInput.GetSelection () (at Assets/NGUI/Scripts/UI/UIInput.cs:1018)
UIInput.ProcessEvent (UnityEngine.Event ev) (at Assets/NGUI/Scripts/UI/UIInput.cs:877)
UIInput.OnGUI () (at Assets/NGUI/Scripts/UI/UIInput.cs:675)


the bug occur like this:
input two chars like "12",
and input two space so like "12  ",
and use mouse select the value,
the error will occur!

and i notice that:
when you use mouse in a empty uiinput drag..
there will be a space " " in the input field...


and i just change the code like this:


   protected string GetLeftText ()
   {
      int min = Mathf.Min(mSelectionStart, mSelectionEnd);
        return (string.IsNullOrEmpty(mValue) || min < 0) ? "" : mValue.Substring(0, Mathf.Min(min, mValue.Length));
   }

   protected string GetSelection ()
   {
      if (string.IsNullOrEmpty(mValue) || mSelectionStart == mSelectionEnd)
      {
         return "";
      }
      else
      {
         int min = Mathf.Min(mSelectionStart, mSelectionEnd);
         int max = Mathf.Max(mSelectionStart, mSelectionEnd);
            return mValue.Substring(min, Mathf.Min(max - min, mValue.Length));
      }
   }

12
NGUI does clipping by using special shaders. You won't be able to make particles clip unless you write special shaders first. Have a look at the difference between "Unlit - Transparent Colored" and "Unlit - Transparent Colored 1" shaders, for example.

the clip panel use the shader "Unlit - Transparent Colored 1 " ??

13
i have some items in a UIScrollView and the items attached with some particles...to let particles show,i changed particles RQ (4000)..but when i scroll items. the hide items's particles still can show...
so what can i do to hide particles with hidden items..

14
NGUI 3 Support / About UIToggle,i want ask a question!
« on: June 27, 2014, 10:17:36 PM »
   /// <summary>
   /// Check or uncheck on click.
   /// </summary>

   void OnClick () { if (enabled) value = !value; }

if i have a single group 0 checkBox, so above code's logic can work well ..
but if i have a group 1 three checkBoxs, and i click the toggled one, the above code's logic i doubt if have some bugs???

15
NGUI 3 Support / About UIToggle group,i meet a problem..
« on: June 27, 2014, 07:45:13 AM »
i create 3 uitoggle item.in editor they are all seted "Starting state" to false..and they all are group 1.
and i registed the changed callback function like this...

public void OnIconCheckChanged()
    {
        Debug.Log("Toggle: " + UIToggle.current.name + " has state of " + UIToggle.current.value);
    }

and i want set the first item checked,so i change the first item's value to true in my script,
at beginning, the first item checed, when i click the first checked item, the log shows "item0 has state of false" while not show "item0 has state of true"?? why?

Pages: [1] 2