monery8 发表于 2013-1-9 16:19

替换鼠标样式

一、//鼠标样式更换为guiText
//将js文件链接到guiText对象即可
function Start()
{
Screen.showCursor=false;
}
function Update()
{
var msPos=Input.mousePosition;
var imgX=msPos.x-Screen.width/2;
var imgY=msPos.y-Screen.height/2;
guiText.pixelOffset =Vector2(imgX,imgY);
}
二、
//用guiTexture代替鼠标样式
//将js链接到guiTexture对象即可
static var curRc=new Rect(0,0,20,20);
function Start()
{
Screen.showCursor=false;
}
function Update()
{
var msPos=Input.mousePosition;
curRc.x=msPos.x-Screen.width/2;
curRc.y=msPos.y-Screen.height/2;
guiTexture.pixelInset=curRc;
}

xiaolangjh 发表于 2017-5-24 18:19

楼主是超人

Mesite 发表于 2017-5-24 18:26

好帖就是要顶

zww00310 发表于 2017-5-24 17:46

顶顶多好

zhaol1698 发表于 2017-5-24 18:13

真心顶

zww00310 发表于 2017-5-24 17:37

不错不错

放课后 发表于 2017-7-7 11:21

很不错

goodspeed2011 发表于 2017-7-7 11:28

楼主是超人

goodspeed2011 发表于 2017-7-7 11:25

顶顶多好

迷途凡尘 发表于 2017-7-7 11:01

难得一见的好帖
页: [1] 2 3 4 5 6 7
查看完整版本: 替换鼠标样式