unity NGUI tutorial scroll view

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脚本。同时方便给你。右键单击任何对象的对撞机内滚动视图并选择连接- >拖动滚动视图。


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


你可以提高你的进一步通过指定滚动条滚动视图。试一试!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值