| 
 
| 赞 | 0 |  
| VIP | 1 |  
| 好人卡 | 3 |  
| 积分 | 1 |  
| 经验 | 9739 |  
| 最后登录 | 2014-6-3 |  
| 在线时间 | 182 小时 |  
 Lv1.梦旅人 
	梦石0 星屑50 在线时间182 小时注册时间2011-2-17帖子518 | 
| http://rpg.blue/forum.php?mod=viewthread&tid=154918 这个是普遍的滚轮 但在我游戏中似乎不太好用 所以我一般都是 用鼠标直接控制上下移动(就是单击上下移动的那个小三角)在鼠标脚本中找
 class Window_Selectable 把那一整段替换成如下内容
 复制代码
class Window_Selectable # BY水迭澜 
if @self_alias == nil 
alias self_update update 
@self_alias = true 
end 
def update 
#self.cursor_rect.empty 
self_update 
if self.active and @item_max > 0 
index_var = @index 
tp_index = @index 
mouse_x, mouse_y = Mouse.get_mouse_pos 
mouse_not_in_rect = true 
for i in 0...@item_max 
@index = i 
update_cursor_rect 
top_x = self.cursor_rect.x + self.x + 16 
top_y = self.cursor_rect.y + self.y + 16 
bottom_x = top_x + self.cursor_rect.width 
bottom_y = top_y + self.cursor_rect.height 
if (mouse_x > top_x) and (mouse_y > top_y) and 
(mouse_x < bottom_x) and (mouse_y < bottom_y) 
mouse_not_in_rect = false 
if tp_index != @index 
tp_index = @index 
$game_system.se_play($data_system.cursor_se) 
end 
break 
end 
end 
if mouse_not_in_rect 
# row = @index / @column_max 
# 当前行被显示开头行前面的情况下 
if self.top_row < row_max-page_row_max and Mouse.press?(Mouse::LEFT) and mouse_y>self.y+self.height/2 
self.top_row +=1 
end 
# 当前行被显示末尾行之后的情况下 
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) 
# 从当前行向末尾滚动 
self.top_row -=1 
end 
@index = index_var 
if self.is_a?(Window_Target) 
@index=-3 
end 
update_cursor_rect 
Mouse.click_lock 
else 
Mouse.click_unlock 
end 
end 
end 
def update_cursor_rect 
# 光标位置不满 0 的情况下 
if @index < 0 
self.cursor_rect.empty 
return 
end 
# 获取当前的行 
row = @index / @column_max 
# 当前行被显示开头行前面的情况下 
if row < self.top_row 
# 从当前行向开头行滚动 
self.cursor_rect.empty 
return 
end 
# 当前行被显示末尾行之后的情况下 
if row > self.top_row + (self.page_row_max - 1) 
# 从当前行向末尾滚动 
self.cursor_rect.empty 
return 
end 
# 计算光标的宽 
cursor_width = self.width / @column_max - 32 
# 计算光标坐标 
x = @index % @column_max * (cursor_width + 32) 
y = @index / @column_max * 32 - self.oy 
# 更新光标矩形 
self.cursor_rect.set(x, y, cursor_width, 32) 
end 
end
 | 
 评分
查看全部评分
 |