分享

GUITexture.pixelInset 像素嵌入

 3dC 2014-03-27

GUITexture.pixelInset 像素嵌入

var pixelInset : Rect

Description描述

Pixel inset used for pixel adjustments for size and position.

像素嵌入用于像素调整大小和位置。

You can set the transform.localScale to Vector3.zero in order to make the GUI texture always the same pixel size.

为了使GUI的纹理总是相同的像素大小,你可以设置transform.localScale到Vector3.zero

GUITexture继承自object 基类,因此不同于一般GUI对象,他具备有Object的属性

关于pixelInset控制在屏幕位置注意:

GUITexture.pixelInset = Rect (x, y, width, height); 此变量用于划定GUITexture的位置及宽高,Rect中x,y的值都为0的时候,所在的位置居于屏幕中心,即的坐标中心是以屏幕中心为(0,0)坐标,它的正负情况符合二维坐标系的四个象限。

transform.position = Vector3.zero;
transform.localScale = Vector3.zero;
guiTexture.pixelInset = Rect (50, 50, 100, 100); 

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多