| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 1 |
| 经验 | |
| 最后登录 | 2013-1-17 |
| 在线时间 | 142 小时 |
辉瑞中国首席研究员<
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 142 小时
- 注册时间
- 2008-1-18
- 回帖
- 2059
|
发表于 2008-8-13 18:59:15
|
显示全部楼层
def update_cursor_rect
# 光标位置不满 0 的情况下
if @index < 0
self.cursor_rect.empty
return
end
# 获取当前的行
row = @index / @column_max
# 当前行被显示开头行前面的情况下
if row < self.top_row
# 从当前行向开头行滚动
self.top_row = row
end
# 当前行被显示末尾行之后的情况下
if row > self.top_row + (self.page_row_max - 1)
# 从当前行向末尾滚动
self.top_row = row - (self.page_row_max - 1)
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
上面这一段定义光标举行的刷新
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * 32 - self.oy
着两句定义位置变化
LZ请自己修改
PS:求人不如求己
想高清楚,请自己看Window_Selectable 系统信息:本贴获得楼主认可,66RPG感谢您的热情解答~ |
|