0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Unity+NGUIで、ScrollViewより上に重ねてUIButton等など配置

Last updated at Posted at 2017-10-27

UnityのNGUIScrollViewを使っていると、
ScrollViewより上に何か画像やボタンを乗せたくなる時がある。
左右のスクロールボタン等。。。

色々探した結果、
ScrollViewのUI PanelSort Orderが描画順を管理しているらしく、
これを重ねたいUISpriteやUIButtonにも管理用にUI Panelを追加し、
**「Sort Order」**で管理すれば
いけた!!

スクリーンショット 2017-10-27 14.37.54.png

最初は頑張って、ノードのネスト位置を変えたり、Depth Orderをいじいじしたり、
強制的にTransfromをいじったりしていましたが、こんな方法があったのとは、
NGUIの公式のサンプルにも載せて欲しい。。。!!(泣)

追記scrollview上にUIButtonを重ねて、そのボタン上でドラッグしてもスクロールするようにする場合UIButton側にも「DragScrollView」コンポーネントを追加する

image.png

検証環境
*Unity2017 2
*MacOSX ElCaptain
*NGUI最新版2017-10-27時点

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?