LoginSignup
4
7

More than 3 years have passed since last update.

2015-08-23 unity > uGUI > scrollbar付きtext > Layout>ContentSizeFitter / UI>Mask / UI>ScrollRect

Last updated at Posted at 2015-08-23
動作確認
Unity 5.1.2-f1 on MacOS X 10.8.5

http://evilonedeath.blog.fc2.com/blog-entry-125.html?sp
に記載されている手順でできる。

以下は、上記からの抜き書き。

  • TextのAnchorを左上にあわせる
  • TextにAdd Componentで Layout>ContentSizeFitter を追加する
  • >> そのVerticalFitをPreferredSizeにする
  • PanelにAdd Componentで UI>Mask を追加する (Panel外のはみでたTextを非表示するため)
  • PanelにAdd Componentで UI>ScrollRect を追加する
  • >> Contentに Textを関連づける (Textがマウスでスクロールできるようになる)
  • UI>Scrollbarを追加
  • UI>Scrollbar をPanel>Scroll Rect (Script) > Vertical Scrollbar に関連付ける (ScrollbarでTextをスクロールできるようになる)

Scene_unity_-_150823_textWithScrollbar_-_PC__Mac___Linux_Standalone__Personal_.jpg

複数のTextのスクロール同期もできる。
Scene_unity_-_150823_textWithScrollbar_-_PC__Mac___Linux_Standalone__Personal_.jpg

ということはアレが作れそう。

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