- 注册时间
- 2004-5-16
- 最后登录
- 2024-11-13
超级版主
传说中的Bunny坑神~!
 
- 积分
- 244543

|
发表于 2005-5-29 16:36:54
|
显示全部楼层
好像不是...
ARROW那两个似乎是战斗中选择敌人和我方角色的类.用来显示WINDOWSKIN里面那红黄两个三角形的...
楼主有没发现你提到的这两类都是 Window_Selectable的下属类....
可以试看看把Window_Selectable里面的这两部分复制到你说的两个类里面,再进行修改.就是重新定义这两个函数.
#--------------------------------------------------------------------------
# ● 设置光标的位置
# index : 新的光标位置
#--------------------------------------------------------------------------
def index=(index)
@index = index
# 刷新帮助文本 (update_help 定义了继承目标)
if self.active and @help_window != nil
update_help
end
# 刷新光标矩形
update_cursor_rect
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.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
|
|