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

Pages: [1]
1
NGUI 3 Documentation / Re: UIScrollView
« on: April 24, 2015, 06:47:02 PM »
Is there a way to shift the upper bounds on a ScrollView to the center? I know there Center on child but I don't want it to "magnetize" to each button. I want the ScrollView to stop at the middle when it reaches it's first and last item instead of stopping at it's bounds.

[SOLVED]
I did this by unchecking Restrict Within Panel and doing my own clamp on the position and offset in an Update loop.

2
NGUI 3 Support / Clear Screen border on iPad Air
« on: July 30, 2014, 06:56:44 PM »
Hi I'm having an issue only on iPad Air on one of my screens which uses only NGUI elements for it's menu. I provided a screenshot of what it kinda looks like (I had to hide the actual assets due to NDA). Why would it be doing this?

Thanks


3
NGUI 3 Support / Re: Trying to adapt a NGUI script
« on: February 22, 2013, 02:45:39 PM »
You have it right. Unity has to build and parse the code though so sometimes there is a lag when adding new attributes.   :D

4
NGUI 3 Support / Wrap around draggable panel
« on: February 22, 2013, 02:25:46 PM »
So I hope the title makes sense.

Essentially what I am trying to do is have a draggable panel much like the one in the example except that when you get to the end it wraps to the beginning. It must center on the first (or last) object.

Currently I have my gui set up with a grid with 3 objects that center and it does wrap around. The problem is that it does not center on the first (or last) item and goes directly to the middle item.

Here is the script that I am currently using for this (C#)

  1. public UIScrollBar scrollBar;
  2.         public float sliderValue, sliderSize;
  3.         public UIDraggablePanel dragPanel;
  4.         public GameObject springPanel;
  5.         SpringPanel spring;
  6.         public UICenterOnChild center;
  7.         public UIGrid grid;
  8.         void Start()
  9.         {
  10.                 spring = (SpringPanel)springPanel.GetComponent<SpringPanel>();
  11.                 Debug.Log ((spring != null));
  12.                
  13.         }
  14.         public void Update()
  15.         {
  16.                 sliderValue = scrollBar.scrollValue;
  17.                 sliderSize = scrollBar.barSize;
  18.                
  19.                 if(sliderValue == 1 && sliderSize < 0.15) //check if we're all the way to the right
  20.                 {
  21.                         center.enabled = false; //Disable to try to get the closest object on re-enable
  22.                         dragPanel.relativePositionOnReset = Vector2.zero;//position to beginning
  23.                         dragPanel.ResetPosition();
  24.                         spring.target = new Vector3(0, 78, - 1);//try to
  25.                         spring.enabled = true;
  26.                         center.enabled = true;
  27.                        
  28.                 }
  29.                 else if(sliderValue == 0 && sliderSize < 0.15)//check if we're all the way to the left
  30.                 {
  31.                         center.enabled = false;
  32.                         dragPanel.relativePositionOnReset = new Vector2(1, 0);//position to end
  33.                         dragPanel.ResetPosition();     
  34.                         spring.target = new Vector3(-600, 78, - 1);
  35.                         spring.enabled = true;
  36.                         center.enabled = true;
  37.                 }      
  38.         }


Any help would be greatly appreciated

Pages: [1]