Author Topic: UICenter on Child... odd jump/snap?  (Read 3463 times)

Sigh@iCreate

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
UICenter on Child... odd jump/snap?
« on: November 07, 2013, 07:23:42 AM »
Hi Guys

I am a little stuck over an issue im having with the UICenter on child feature.

Here is what I have:
- Panel with Draggable Panel
    - Grid (has grid script and centre on child)
       - Information Pages (contain textures and buttons, and draggable contents script) x4

Now the problem im having is that when I drag a new information page in (think of dragging a full screen across on an ipad), it comes in smoothly, and then when the image gets fully into the scene (the image is a little smaller than fullscreen), it jumps to the center of the screen.

The amount it jumps/snaps seems to be the equivalent of the gap that is around my texture on the x axis? So for example my screen resolution is 1024x768 and my texture is 940x700.

so to clarify once my image is fully in the scene (the back edge of the image is flush with the edge of the screen), it snaps to the center so that the gap around the edge is visible.

I cant seem to get my head around why this is, but I have a feeling it is to do with the size of my panels?

Thanks for any help anyone can provide.

Also let me know if more information would help?

Thanks

Sigh

Thought some images may help to clarify even more.
here is the first, the image is coming in from the left, and it travels smoothly until it reaches this point:


Then what it looks like after it snaps:


« Last Edit: November 07, 2013, 07:32:02 AM by Sigh@iCreate »

Sigh@iCreate

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: UICenter on Child... odd jump/snap?
« Reply #1 on: November 11, 2013, 05:59:16 AM »
I am still having problems with this, I have looked at the NGUI example, which doesnt appear to have the same problem, I changed my settings to match (in the sense that the strength and such were the same) but I still have that odd jump.
Thanks again for any time given. 

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UICenter on Child... odd jump/snap?
« Reply #2 on: November 11, 2013, 04:41:48 PM »
I am not quite clear on what your issue is. I can only suggest check the clipping rectangle on the panel and use the reposition checkbox on the draggable panel script.

The entire way of specifying clipped rects and doing draggable panels is actually getting changed within the next ~2 weeks. It should suck a lot less then. <_<

Sigh@iCreate

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: UICenter on Child... odd jump/snap?
« Reply #3 on: November 12, 2013, 05:27:20 AM »
Hey thanks for getting back to me.

I will look into what you suggest.

I also look forward to the changes. Thanks again for your time.

Sigh


Edit: Hey if you get more time to look at this id appreciate it. If not, thanks for your time anyway.

I am a little unsure how to explain the issue in more detail. But ill give it a shot.

Essentially think of the scroll-view example on a much larger scale I guess, where the individual items are almost full screen pages. Therefore the grid cell width is a full screen width.

From the testing I just did in a new scene, the problem is not apparent at lower grid cell widths and becomes progressively worse the higher the cell width... For example on cell widths less than 400 its unnoticeable, but beyond...

The problem effectively is that the new child to center on, moves towards the center of the panel smoothly, but once it hits a certain point (which is near the center, but not quite), it just jumps to the center, creating a jerk like effect at the end.
Thanks, if nothing comes to mind dont worry. I am also aware that this is perhaps not designed for this kind of use, most examples I see, seem to be for the use in 'shops' and item selection etc.
I just felt this seemed like an easy way to have sliding screens. 
« Last Edit: November 12, 2013, 07:36:19 AM by Sigh@iCreate »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UICenter on Child... odd jump/snap?
« Reply #4 on: November 12, 2013, 03:01:59 PM »
It's probably related to interpolation on line 613 of UIDraggablePanel:
  1. if (constraint.magnitude > 0.001f)
Did you try it in 3.0.5?

Sigh@iCreate

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 6
    • View Profile
Re: UICenter on Child... odd jump/snap?
« Reply #5 on: November 13, 2013, 05:11:09 AM »
Hi Aren

Just checked, I was using an older version, but I have updated to 3.0.5.
The problem still persists, though I have yet to make any other changes. I will look into it, thanks for suggesting that line of code. I will look into it and report any findings.

Thanks again.

Sigh