[Unity3D]GUI 效果一览


摘自:http://user.qzone.qq.com/175707544/blog/1251041134

function OnGUI() {

  GUI.Label(Rect(1,1,100,20),"I'm a Label"); //1

  GUI.Box(Rect(1,21,100,20),"I'm a Box"); //2

  GUI.Button(Rect(1,41,100,20),"I'm a Button"); //3

  GUI.RepeatButton(Rect(1,61,120,20),"I'm a RepeatButton"); //4

  GUI.TextField(Rect(1,81,100,20),"I'm a TextFielld"); //5

  GUI.TextArea(Rect(1,101,100,40),"I'm a TextArea,\nMultiline"); //6

  GUI.Toggle(Rect(1,141,120,20),true,"I'm a Toggle true"); //7

  GUI.Toggle(Rect(1,161,120,20),false,"I'm a Toggle false"); //8

  GUI.Toolbar(Rect(1,181,160,20),-1,["Toolbar","Tool2","Tool3"]); //9

  GUI.SelectionGrid(Rect(1,201,190,20),2,["Selection","Grid","select3"],3); //10

  GUI.HorizontalSlider(Rect(1,221,180,20),3.0,0,10.0); //11

  GUI.VerticalScrollbar(Rect(1,241,20,100),3.0,1,0.0,10.0); //12

 

  //13

  GUI.BeginScrollView (Rect (200,10,100,100),Vector2.zero, Rect (0, 0, 220, 200));

  GUI.Label(Rect(0,0,100,20),"I'm a Label");

  GUI.EndScrollView();

  //14

    GUI.Window(0,Rect(200,129,100,100),funcwin,"window");

}

 

function funcwin(windowID:int)

 {

  GUI.DragWindow(Rect(0,0,10000,2000));

 }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值