学一下Scroll View。

NGUi学习之Scroll View

NGUI的封装还是不错的,自动排列,可定义一行的个数,然后自动换行。

首先得动态能添加控件,然后加到UITable容器里。

for (int i = 0; i < 10; i++)
        {
            GameObject go = NGUITools.AddChild(gameObject, template);
            
            UIDragCamera uc = go.GetComponent<UIDragCamera>();
            uc.draggableCamera = seeCam;
            go.transform.localScale = template.transform.localScale;
            
            
            item = go.transform.FindChild("UISprite").gameObject.GetComponent<UISprite>();
            item.spriteName = "Orc Armor - Bracers";
            
            
            UITable ut = gameObject.GetComponent<UITable>();
            ut.Reposition();
        }

 

效果:

NGUi学习之Scroll View

相关文章:

  • 2021-08-13
  • 2022-01-17
  • 2021-06-25
  • 2021-11-09
  • 2022-12-23
  • 2021-09-15
  • 2021-10-25
  • 2021-12-12
猜你喜欢
  • 2022-12-23
  • 2021-09-18
  • 2022-12-23
  • 2021-12-08
  • 2021-04-13
  • 2021-11-20
  • 2021-08-14
相关资源
相似解决方案