设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1634|回复: 11
打印 上一主题 下一主题

话说,鼠标系统的俩问题

 关闭 [复制链接]
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-3-30
帖子
537
跳转到指定楼层
1
发表于 2008-7-3 04:46:32 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-3-30
帖子
537
2
 楼主| 发表于 2008-7-3 21:14:50 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-5-30
帖子
385
3
发表于 2008-7-3 21:24:48 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-3-30
帖子
537
4
 楼主| 发表于 2008-7-3 21:56:54 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
93 小时
注册时间
2008-5-16
帖子
745
5
发表于 2008-7-4 02:41:10 | 只看该作者
第一个问题还是把图给放上去吧
第二个问题将该脚本放Main前
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================

  4. class Window_Selectable
  5.   if @self_alias == nil
  6.     alias self_update update
  7.     @self_alias = true
  8.   end
  9.   def update
  10.     #self.cursor_rect.empty
  11.     self_update
  12.     if self.active and @item_max > 0
  13.       index_var = @index
  14.       tp_index = @index
  15.       mouse_x, mouse_y = Mouse.get_mouse_pos
  16.       mouse_not_in_rect = true
  17.       for i in 0...@item_max
  18.         @index = i
  19.         update_cursor_rect
  20.         top_x = self.cursor_rect.x + self.x + 16
  21.         top_y = self.cursor_rect.y + self.y + 16
  22.         bottom_x = top_x + self.cursor_rect.width
  23.         bottom_y = top_y + self.cursor_rect.height
  24.         if (mouse_x > top_x) and (mouse_y > top_y) and
  25.            (mouse_x < bottom_x) and (mouse_y < bottom_y)
  26.           mouse_not_in_rect = false
  27.           if tp_index != @index
  28.             tp_index = @index
  29.             $game_system.se_play($data_system.cursor_se)
  30.           end
  31.           break
  32.         end
  33.       end
  34.       if mouse_not_in_rect
  35.         #  row = @index / @column_max
  36.           # 当前行被显示开头行前面的情况下
  37.           if self.top_row < row_max-page_row_max and Mouse.press?(Mouse::LEFT) and mouse_y>self.y+self.height/2
  38.             self.top_row +=1
  39.           end
  40.           # 当前行被显示末尾行之后的情况下
  41.           if self.top_row > 0 and Mouse.press?(Mouse::LEFT) and mouse_y<=self.y+self.height/2#self.top_row + (self.page_row_max - 1)
  42.             # 从当前行向末尾滚动
  43.             self.top_row -=1
  44.           end
  45.         @index = index_var
  46.         if self.is_a?(Window_Target)
  47.           @index=-3
  48.         end
  49.         update_cursor_rect
  50.         Mouse.click_lock
  51.       else
  52.         Mouse.click_unlock               
  53.       end
  54.     end
  55.   end
  56.   def update_cursor_rect
  57.     # 光标位置不满 0 的情况下
  58.     if @index < 0
  59.       self.cursor_rect.empty
  60.       return
  61.     end
  62.     # 获取当前的行
  63.     row = @index / @column_max
  64.     # 当前行被显示开头行前面的情况下
  65.     if row < self.top_row
  66.       # 从当前行向开头行滚动
  67.       self.cursor_rect.empty
  68.       return
  69.     end
  70.     # 当前行被显示末尾行之后的情况下
  71.     if row > self.top_row + (self.page_row_max - 1)
  72.       # 从当前行向末尾滚动
  73.       self.cursor_rect.empty
  74.       return
  75.     end
  76.     # 计算光标的宽
  77.     cursor_width = self.width / @column_max - 32
  78.     # 计算光标坐标
  79.     x = @index % @column_max * (cursor_width + 32)
  80.     y = @index / @column_max * 32 - self.oy
  81.     # 更新光标矩形
  82.     self.cursor_rect.set(x, y, cursor_width, 32)
  83.   end
  84. end



  85. #==============================================================================
  86. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  87. #==============================================================================

复制代码
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-3-30
帖子
537
6
 楼主| 发表于 2008-7-4 03:24:54 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-7-4
帖子
20
7
发表于 2008-7-4 03:27:37 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-3-30
帖子
537
8
 楼主| 发表于 2008-7-4 03:29:18 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-7-4
帖子
20
9
发表于 2008-7-4 03:41:14 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-3-30
帖子
537
10
 楼主| 发表于 2008-7-4 03:57:48 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2025-8-8 11:13

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表