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);  } }

 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 (, , , ), str);
GUI.Label (new Rect (, , , ), "当前屏幕宽"+screenWidth);
GUI.Label (new Rect (, , , ), "当前屏幕高"+screenHeight);
}
}

游戏 标签gui.label的更多相关文章

  1. 游戏引擎/GUI的设计与实现-序

    几年前写<嵌入式GUI FTK设计与实现>,没写几篇就停止更新了.当时自己研究过MicroWindows, X Window, DirectFB, GTK+和Android的GUI,又写过 ...

  2. Cocos2d-x 3.0标签类Label

    Cocos2d-x 3.0后推出了新的标签类Label,这种标签通过使用FreeType[1]来使它在不同的平台上有相同的视觉效果.由于使用更快的缓存代理,它的渲染也将更加快速.Label提供了描边和 ...

  3. 小tips:JS语法之标签(label)

    JavaScript语言允许,语句的前面有标签(label),相当于定位符,用于跳转到程序的任意位置,标签的格式如下. label: statement 标签可以是任意的标识符,但是不能是保留字,语句 ...

  4. 8、html的body内标签之fieldset标签和label标签

    一.label标签 <label> 标签为 input 元素定义标签(label). label 元素不会向用户呈现任何特殊的样式.不过,它为鼠标用户改善了可用性,因为如果用户点击 lab ...

  5. 列表框、分组列表框、标签(label)、分组框(fieldset)、框架(frameset)

    列表框(select) 下拉列表,用户可以从一些可选项中选择. 示例:简单的下拉列表 <select name="country"> <option value= ...

  6. unity3d 改动gui label颜色,定义颜色需除以256

    GUIStyle titleStyle2 = new GUIStyle(); titleStyle2.fontSize = 20; titleStyle2.normal.textColor = new ...

  7. k8s核心资源之:标签(label)

    简介 label是标签的意思,一对 key/value ,被关联到对象上,k8s中的资源对象大都可以打上标签,如Node.Pod.Service 等 一个资源可以绑定任意多个label,k8s 通过  ...

  8. 标签(Label、JLabel)

    构造函数 Label( ) Label(String str) Label(String str, int how) 第一种形式生成一个空白标签:第二种形式生成一个包含由参数str所设定的字符串的标签 ...

  9. html的body内标签之label标签和fieldset标签

    1. <label> 标签为 input 元素定义标注(标记). label 元素不会向用户呈现任何特殊效果.不过,它为鼠标用户改进了可用性.如果您在 label 元素内点击文本,就会触发 ...

随机推荐

  1. NSArray和NSMutableArray

    //1. NSArray EOItems *eOItems = [[EOItems alloc] init]; eOItems.ID = [NSNumber numberWithInt:]; NSAr ...

  2. DrClient 校园网客户端破解

    好吧..详细点.这个功能就是破解学校的限制 让你开无线网共享给手机的时候 不会被断网 提示有代理软件..这样帮你电脑省好多流量.平板电脑也是 软件叫Process Explorer 不大 1M多 自己 ...

  3. C#开发实例 鼠标篇

    鼠标的操作控制: 鼠标是计算机的一个重要组成部分,有很多默认的设置,如双击时间间隔,闪烁频率,移动速度等,本篇使用C#获取这些基本的信息. 1.1获取鼠标信息 ①实例001 获取鼠标双击时间间隔 主要 ...

  4. meanshift和camshift

    参考:http://www.cnblogs.com/tornadomeet/archive/2012/03/15/2398769.html 照着这位大神的代码运行了一下,发现meanshift的跟踪效 ...

  5. DCMTK3.6.1(MD支持库)安装说明

    转载:http://qimo601.iteye.com/blog/1685135 [前言] 最近,因为需要开发DICOM网管模块,必须使用DCMTK的DcmNet模块.但是DCMTK3.6.0在Dcm ...

  6. 【转】Eclipse中查看jar包中的源码

    (简单的方式:通过jd-gui来进行反编译,最简单!,参考我的另一篇博文, 地址:http://www.cnblogs.com/gmq-sh/p/4277991.html) Java Decompil ...

  7. iOS viewDidAppear 和 viewWillAppear

    今天发现,如果用navigation push一个controller,那么从动画开始就调用viewwillappear,动画全部停止才会调用viewDidAppear,不知道是否正确,先做记录,带验 ...

  8. Mybatis各种模糊查询

    转载自:http://blog.sina.com.cn/s/blog_667bef380101f2da.html 工作中用到,写三种用法吧,第四种为大小写匹配查询 1. sql中字符串拼接 SELEC ...

  9. [Linux] 孤儿进程与僵尸进程[总结]

    转载: http://www.cnblogs.com/Anker/p/3271773.html 1.前言 之前在看<unix环境高级编程>第八章进程时候,提到孤儿进程和僵尸进程,一直对这两 ...

  10. 在Spring3中,配置DataSource的方法有6种。

    第一种:beans.xml Xml代码 收藏代码<bean id="dataSource" class="org.apache.commons.dbcp.Basic ...