def update_cursor_rect #@back.bitmap = RPG::Cache.menu("item_command"+type.to_s) # 光标位置不满 0 的情况下 if @index < 0 self.cursor_rect.empty return end # 获取当前的行 column = @index # 当前行被显示开头行前面的情况下 if column < self.top_column # 从当前行向开头行滚动 self.top_column = column end # 当前行被显示末尾行之后的情况下 if column > self.top_column + (self.page_column_max - 1) # 从当前行向末尾滚动 self.top_column = column - (self.page_column_max - 1) end # row = @index # 当前行被显示开头行前面的情况下 # 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 # @right.x = self.x+72+self.top_column.to_f*66.0*(4*66)/(@item_max.to_f*66) # 计算光标的宽度 cursor_width = 1200 # 计算光标坐标 # x = 4 + index % 2 * (288 + 32) # y = index / 2 * 32 #x =32+ @index*66 - self.ox-1# 8 # x =10 +@index% 4 * (84 + 1) y =5+ @index/ 4 * 120 z = 1999 #y = 14 #@index*20 - self.oy-1 # 更新光标矩形 self.cursor_rect.set(x, y, 84 ,120) end
#-------------------------------------------------------------------------- # ● 刷新画面 #-------------------------------------------------------------------------- def update super # (Input::UP) (Input::DOWN) (Input::RIGHT) (Input::LEFT) # 可以移动光标的情况下 if self.active and @item_max >= 0 and @index >= 0 # 方向键下被按下的情况下 if Input.repeat?(Input::RIGHT) # 光标向左移动 $game_system.se_play($data_system.cursor_se) @index = (@index+1+@item_max) % @item_max if @item_max != 0 update_help end # 方向键上被按下的情况下 if Input.repeat?(Input::LEFT) # 光标向右移动 $game_system.se_play($data_system.cursor_se) @index = (@index-1+@item_max) % @item_max if @item_max != 0 update_help end end #------------------------------------------------------------------------- if self.active and @item_max >= 0 and @index >= 0 # 方向键下被按下的情况下 if Input.repeat?(Input::UP) # 光标向左移动 $game_system.se_play($data_system.cursor_se) @index = (@index+1+@item_max) / @item_max if @item_max != 0 update_help end # 方向键上被按下的情况下 if Input.repeat?(Input::DOWN) # 光标向右移动 $game_system.se_play($data_system.cursor_se) @index = (@index-1+@item_max) / @item_max if @item_max != 0 update_help end #------------------------------------------------------------------------- end # 刷新帮助文本 (update_help 定义了继承目标) if @help_window != nil and @ajsdgfshfajklshfa == nil update_help update_help @ajsdgfshfajklshfa = true end # 刷新光标矩形 update_cursor_rect end def now_selected_troop return @all_fighters[@index] end
1下一页.png (648.68 KB, 下载次数: 38)
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |