您的位置:首页 > 移动开发 > Unity3D

unity NGUI tutorial scroll view

2015-12-04 14:33 459 查看
Scroll views are extremely simple to make in NGUI. Select a widget, Right-Click -> Create ->Scroll View.

To make it possible to navigate the scroll view using mouse or touch events you will need one or more colliders with UIDragScrollView script attached. NGUI makes it easy for you. Right-click
on any object with a collider inside the scroll view and choose Attach ->Drag Scroll View.

Note that if you have many colliders inside your scroll view, you will need to attach the Drag Scroll View script to all of them. In this example all "NGUI" images
have colliders, and so does the Scroll View Background sprite.

You can improve your scroll view further by specifying a Scroll Bar. Give it a try!

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

同时滚动视图是极其简单的。选择一个小部件,单击右键- >创建- >滚动视图。

可以导航滚动视图使用鼠标或触摸事件,你需要一个或多个对撞机附带UIDragScrollView脚本。同时方便给你。右键单击任何对象的对撞机内滚动视图并选择连接- >拖动滚动视图。

请注意,如果你有很多对撞机内滚动视图,您将需要拖动滚动视图脚本附加到所有的人。在这个例子中所有图像对撞机“同时”,所以滚动视图的背景精灵。

你可以提高你的进一步通过指定滚动条滚动视图。试一试!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: