2

I made the Scrollable View in NGUI using following tutorials Here but how can I use button to scroll the objects. Like If i click on up button it ScrollView should be up and If i click on down ScrollView should be down.

Your help will be appreciated. Thanks.

enter image description here

2 Answers 2

3

I just figure out how to do this.

SpringPanel.Begin ( GameObject go,Vector3 pos,float strength ) 

here GameObject is NGUI gameObject such as ScrollView and pos is position what amount should scrollview move and strength is that related to speed. hope you will find useful.

Sign up to request clarification or add additional context in comments.

3 Comments

Hey there, can you give in the additional details on HOW EXACTLY did you achieve this in NGUI? Because this seems like a static method and how is spring panel refereed and in which script. Please provide addition details. Thanks
Begin is a SpringPanel static method, see reference here.
Hi @user1683989 i just explain about spring.panel hope it is useful for you.
2

You can do two different things to have scrolling button, depending what do you mean.

  1. If you want to have a scroll button, you should create UIScrollBar component, which you will attach to you UIScrollView as a horizontal or vertical scroll bar. See NGUI examples included to the package.
  2. If you want to have a object on your list, which clicked will allow you to drag the UIScrollView, you should attach to this gameObject a UIDragScrollView component. It will allow you to drag-to-scroll behavior, similar to mobile list dragging experience. Again, such example should be included to the package.

EDIT: After your question clarification, the answer should be a bit different.

You should write a script, with a reference to your UIScrollView and then you should call on it MoveRelative( Vector3 relative ) or MoveAbsolute( Vector3 absolute ), which will move the scroll view.

6 Comments

actually i want a arrow button up and down. when i click on up button is should go up and if i click on down button it should go down like such functionality.
Ok, so you should clarify your question, to be precise about what are you asking.
ok i will always clarify my question. actually i am little bit in rush.
How it should move smoothly. Because code i have written is reaching to target position directly.
You can implement your own Tween - inherit from base class UITweener and on OnUpdate call one of the Move functions with actual delta time (there should be small move values). Then on button you should start your tween. See UITweener reference: tasharen.com/ngui/docs/…
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.