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 - PoL

Pages: [1]
1
NGUI 3 Support / Bug in UIScrollView
« on: June 11, 2014, 02:11:33 AM »
Currently there is something like this:

  1. public void InvalidateBounds () { mCalculatedBounds = true; }

But rather should be something like this:

  1. public void InvalidateBounds () { mCalculatedBounds = false; }

2
NGUI 3 Support / UIInput.inputType change at runtime
« on: February 12, 2014, 11:43:14 AM »
When I change the field UIInput.inputType at runtime, it does't update the label text.

To update the label I need to do something like this:

  1. inputPassword.inputType = show ? UIInput.InputType.Standard : UIInput.InputType.Password;
  2. string v = inputPassword.value;
  3. inputPassword.value = v.Length == 0 ? " " : "";
  4. inputPassword.value = v;
  5.  

Better solution for this could be making the method UIInput.UpdateLabel() public or replacing the field UIInput.inputType with a propertie.

3
A have a panel, whose child's are not modified in 99,9% of it's life time. So I decided to make it static. In the rest 0.01% of time, I need to change the transform of some of it's child, but the change isn't visible because the UpdateTransforms() isn't rebuilding the geometry. I did a workaround by adding a method to the UIPanel:

  1. public void ForceUpdateTransforms() {
  2.         mWidgetsAdded = true;
  3. }

Setting the 'mWidgetsAdded' flag to true, forces the geometry to be rebuild. Is there any other way to force geometry rebuild (on-demand) on static panel? If not, please add this or something similar to the UIPanel.

Best regards!

4
NGUI 3 Support / Re: Extending the 'symbol' (icon) features of font
« on: March 01, 2013, 02:09:28 PM »
When I was putting an icon in to the text that was bigger then the text height, the icon was positioned relative to the top of the text... It did not looked good. I needed to align the icon vertical in the middle of the text. With the Y offset I was able to correct the vertical position.

Thanks a lot for adding it in to the NGUI :-)

5
NGUI 3 Support / Extending the 'symbol' (icon) features of font
« on: March 01, 2013, 05:21:55 AM »
Note: This message is awaiting approval by a moderator.
I need to extend the functionality of symbols/icons in font by adding the X and Y offset of icon. I did that my self, but it would by nice to have it in the NGUI original source.

Here is what I did::

1. BMSymbol:

Added at line 21:
  1.         public int offsetX;
  2.         public int offsetY;
  3.  

2. UIFont.Print():

Line 937:
  1.         v0.x =  scale.x * x; -> v0.x =  scale.x * (x + symbol.offsetX);
Line 938:
  1.         v0.y = -scale.y * y; -> v0.y = -scale.y * (y + symbol.offsetY);

3. BMFontReader.Load()

Added at line 173:
  1.         symbol.offsetX  = GetInt(split[6]);
  2.         symbol.offsetY  = GetInt(split[7]);
  3.  

After this few modification one can add X, Y offset to icons in text.
 
  1. symbol sequence=icon x=163 y=124 width=93 height=62 xoffset=0 yoffset=-20
  2.  

Is there a chance to have it in the original NGUI code?

Pages: [1]