|
主题: 关于鼠标位置
|
 sunyi_5d
职务:普通成员
等级:1
金币:0.0
发贴:48
注册:2001/3/6 11:12:36
|
#12001/3/14 15:41:35
我想做一个当鼠标在(200,400)--(400,440)范围之内时某个演员sprite(2)出现,该怎样写Lingo?
|
 dexn
职务:普通成员
等级:1
金币:1.0
发贴:157
注册:2000/12/7 21:54:20
|
#22001/3/14 17:28:04
不知道你该区域有没有其他角色,所以用以下办法: on exitframe me mymouseloc=the mouseloc mousex=mymouseloc.loch mousey=mymouseloc.locv if (mousex>200 and mousex<400) and (mousey>400 and mousey<440 then sprite(2).loc=point(***,***) end if end
|
 sunyi_5d
职务:普通成员
等级:1
金币:0.0
发贴:48
注册:2001/3/6 11:12:36
|
#32001/3/16 12:29:50
to  exn Thank you! I see.
|
 jiesun
职务:普通成员
等级:1
金币:1.0
发贴:182
注册:2000/12/13 9:54:52
|
#42001/3/16 12:38:26
我的做法是在你想要的热区上面放一个同样大小的空白的text,让它透明,然后在它上面加一个behavoir: on mouseWithin sprite(2).loc=point(***,***) end
on mouseLeave sprite(2).loc=point(***,***) end
|
 Call Me Simon
职务:普通成员
等级:2
金币:2.0
发贴:646
注册:2000/9/19 13:56:51
|
#52001/3/16 19:48:33
比较简单的方法可能是
1. 用point.inside(rect)这一功能, 来判断mouse 的位置是否在所定义的区域内。
2.画一个unfilled rectagle shape,作为不可见的sprite , 其dimension就是你所定义的rect, 用它来检测mouse 的位置实现交互。
|