首页 > 其他 > 详细

游戏 标签gui.label

时间:2014-02-04 03:05:30      阅读:300      评论:0      收藏:0      [点我收藏+]

using UnityEngine; using System.Collections;

public class Gui : MonoBehaviour {

 public string str;

 public Texture imageTexture;

 private int screenWidth;

 private int screenHeight;  // Use this for initialization  void Start () {   screenWidth = Screen.width;   screenHeight = Screen.height;  }    // Update is called once per frame  void Update () {    }

 void OnGUI()  {   GUI.Label (new Rect (100, 10, 100, 30), str);   GUI.Label (new Rect (100, 40, 100, 30), "当前屏幕宽"+screenWidth);   GUI.Label (new Rect (100, 80, 100, 30), "当前屏幕高"+screenHeight);  } }

 

 

bubuko.com,布布扣
 1 using UnityEngine;
 2 using System.Collections;
 3 
 4 public class Gui : MonoBehaviour {
 5 
 6     public string str;
 7 
 8     public Texture imageTexture;
 9 
10     private int screenWidth;
11 
12     private int screenHeight;
13     // Use this for initialization
14     void Start () {
15         screenWidth = Screen.width;
16         screenHeight = Screen.height;
17     }
18     
19     // Update is called once per frame
20     void Update () {
21     
22     }
23 
24     void OnGUI()
25     {
26         GUI.Label (new Rect (100, 10, 100, 30), str);
27         GUI.Label (new Rect (100, 40, 100, 30), "当前屏幕宽"+screenWidth);
28         GUI.Label (new Rect (100, 80, 100, 30), "当前屏幕高"+screenHeight);
29     }
30 }
bubuko.com,布布扣

游戏 标签gui.label

原文:http://www.cnblogs.com/yufenghou/p/3537628.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!