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

Pages: [1]
1
NGUI 3 Documentation / Re: UIButton
« on: November 04, 2014, 11:37:20 AM »
Thanks for the response; I changed repositionNow to Reposition(), but I'm still seeing the overlap. I've also tried changing the MarkAsChanged() call to ProcessText().

2
NGUI 3 Documentation / Re: UIButton
« on: November 04, 2014, 09:00:38 AM »
Hello, I have a dynamic table of UIButtons. If I change the text value of the button's UIlabel to something that is larger than a single line of text I find that the buttons will overlap in the table, but calling execute on the table in the Unity editor will reposition everything just fine.

What I am doing in my code when creating the buttons and setting their text is:

  1. labelComponent.text = question;
  2. abelComponent.MarkAsChanged();
  3.  

After all buttons are added I call:

  1. questionTable.repositionNow = true;
  2.  

I'm not seeing the buttons properly positioned though, and I'm wondering if the reposition is occurring before the UILabel has had a chance to re-calculate its bounds. I was wondering what the best way to go about this would be.

3
NGUI 3 Support / Re: UIScrollView OnDragStarted Event
« on: July 30, 2014, 01:02:04 PM »
I should be on 3.6.8, though it's quite possible the package wasn't updated properly. I'll look into it, thanks.

4
NGUI 3 Support / UIScrollView OnDragStarted Event
« on: July 30, 2014, 08:39:04 AM »
Just had a quick question; I was trying to subscribe to the OnDragStarted event since I need to know when the user is dragging or scrolling through my UIWrapContent.

When testing it, the function was not being called and I found that the event is only thrown if smoothDragStart is true. Was wondering if that is intended. My expectation would be the event would be thrown regardless of being set to smooth or precise.

Thanks in advanced.

Code snippet for reference:

  1. public void Drag ()
  2. {
  3.         if (enabled && NGUITools.GetActive(gameObject) && mShouldMove)
  4.         {
  5.                 if (mDragID == -10) mDragID = UICamera.currentTouchID;
  6.                 UICamera.currentTouch.clickNotification = UICamera.ClickNotification.BasedOnDelta;
  7.  
  8.                 // Prevents the drag "jump". Contributed by 'mixd' from the Tasharen forums.
  9.                 if (smoothDragStart && !mDragStarted)
  10.                 {
  11.                         mDragStarted = true;
  12.                         mDragStartOffset = UICamera.currentTouch.totalDelta;
  13.                         if (onDragStarted != null) onDragStarted();
  14.                 }
  15. ...
  16.  

5
NGUI 3 Documentation / Re: UIScrollView
« on: July 23, 2014, 09:43:55 AM »
Thanks ArenMook, i'll give it a try!

6
NGUI 3 Documentation / Re: UIScrollView
« on: July 22, 2014, 10:29:22 AM »
Hello, I'm creating a type of chat log using a UITable full of UILabels and a UIScrollView.

In order to conserve memory I would like to only use a pool of 10 UILabels in an array (only 8 lines of text are visible anyways), but would like to scroll as if there were more (we're capping the max messages in the log to about 100).

So essentially I was wondering if there was a way for me to control the size of the scroll bar to fake there being more child UILabels than there actually are, giving the illusion that the user is scrolling through more than just 10.

Thanks in advance, and let me know if you need any clarification.

Pages: [1]