查看: 1613|回复: 3

[已经过期] 新建的窗口中怎么用鼠标控制

[复制链接]
梦石
0
星屑
50
在线时间
83 小时
注册时间
2010-8-18
回帖
48
发表于 2012-1-8 19:10:01 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
在选人系统中不能用鼠标控制,脚本要怎么改
上个附件,改后传上来或者说下怎么改,谢谢


Project2.rar (593.37 KB, 下载次数: 41)

梦石
0
星屑
3181
在线时间
1439 小时
注册时间
2009-7-27
回帖
1187
发表于 2012-1-8 20:15:45 | 显示全部楼层
先记录下相应坐标范位,然后在公共事件并行处理以下内容:

mouse_x, mouse_y = Mouse.get_mouse_pos
if Mouse.press?(Mouse::LEFT)
if mouse_x > 0 and mouse_x < 320 and
mouse_y > 200 and mouse_y < 480
$game_temp.common_event_id = 1
end
end

等待1帧

则当鼠标点击X(0-320),y(200-480)的范位的时候,会调用公共事件1号。以此类推,把所有的范为和公共事件设置好就行了。举例如下

mouse_x, mouse_y = Mouse.get_mouse_pos
if Mouse.press?(Mouse::LEFT)
if mouse_x > 0 and mouse_x < 320 and
mouse_y > 100 and mouse_y < 200
$game_temp.common_event_id = 1
end
end

if Mouse.press?(Mouse::LEFT)
if mouse_x > 0 and mouse_x < 320 and
mouse_y > 200 and mouse_y < 300
$game_temp.common_event_id = 2
end
end

if Mouse.press?(Mouse::LEFT)
if mouse_x > 0 and mouse_x < 320 and
mouse_y > 300 and mouse_y < 400
$game_temp.common_event_id = 3
end
end

博客:我的博客
回复

使用道具 举报

梦石
0
星屑
50
在线时间
83 小时
注册时间
2010-8-18
回帖
48
 楼主| 发表于 2012-1-10 13:04:57 | 显示全部楼层
爆焰 发表于 2012-1-8 20:15
先记录下相应坐标范位,然后在公共事件并行处理以下内容:

mouse_x, mouse_y = Mouse.get_mouse_pos

这个是鼠标点某个区域执行事件把,我是说你上次传给我的选人系统,我加个鼠标上去但还是要用键盘才能控制
回复

使用道具 举报

梦石
0
星屑
50
在线时间
83 小时
注册时间
2010-8-18
回帖
48
 楼主| 发表于 2012-1-10 13:05:09 | 显示全部楼层
爆焰 发表于 2012-1-8 20:15
先记录下相应坐标范位,然后在公共事件并行处理以下内容:

mouse_x, mouse_y = Mouse.get_mouse_pos

这个是鼠标点某个区域执行事件把,我是说你上次传给我的选人系统,我加个鼠标上去但还是要用键盘才能控制
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部