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

Project1

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

[已经过期] 光标左右方向正常,上下不能用

[复制链接]

Lv4.逐梦者

梦石
0
星屑
6286
在线时间
1103 小时
注册时间
2015-8-15
帖子
658
跳转到指定楼层
1
发表于 2023-4-12 16:44:53 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 金芒芒 于 2023-4-12 17:12 编辑

RUBY 代码复制
  1. def update_cursor_rect
  2.     #@back.bitmap = RPG::Cache.menu("item_command"+type.to_s)
  3.     # 光标位置不满 0 的情况下
  4.     if @index < 0
  5.       self.cursor_rect.empty
  6.       return
  7.     end
  8.  
  9.     # 获取当前的行
  10.     column = @index
  11.     # 当前行被显示开头行前面的情况下
  12.     if column < self.top_column
  13.       # 从当前行向开头行滚动
  14.       self.top_column = column
  15.     end
  16.     # 当前行被显示末尾行之后的情况下
  17.     if column > self.top_column + (self.page_column_max - 1)
  18.       # 从当前行向末尾滚动
  19.       self.top_column = column - (self.page_column_max - 1)
  20.     end
  21.   #   row = @index
  22.     # 当前行被显示开头行前面的情况下
  23. #    if row < self.top_row
  24.       # 从当前行向开头行滚动
  25. #      self.top_row = row
  26. #    end
  27.     # 当前行被显示末尾行之后的情况下
  28.   #    if row > self.top_row + (self.page_row_max - 1)
  29.       # 从当前行向末尾滚动
  30. #     self.top_row = row - (self.page_row_max - 1)
  31. #   end
  32.  
  33.   #  @right.x = self.x+72+self.top_column.to_f*66.0*(4*66)/(@item_max.to_f*66)
  34.  
  35.     # 计算光标的宽度
  36.     cursor_width = 1200
  37.     # 计算光标坐标
  38. #   x = 4 + index % 2 * (288 + 32)
  39.   #  y = index / 2 * 32
  40.   #x =32+ @index*66 - self.ox-1# 8 #
  41.      x =10 +@index% 4 * (84 + 1)
  42.      y =5+ @index/ 4 * 120
  43.      z = 1999
  44.     #y = 14 #@index*20 - self.oy-1
  45.     # 更新光标矩形
  46.     self.cursor_rect.set(x, y, 84 ,120)
  47.   end

RUBY 代码复制
  1. #--------------------------------------------------------------------------
  2.   # ● 刷新画面
  3.   #--------------------------------------------------------------------------
  4.   def update
  5.     super
  6.    # (Input::UP)  (Input::DOWN)  (Input::RIGHT) (Input::LEFT)
  7.     # 可以移动光标的情况下
  8.     if self.active and @item_max >= 0 and @index >= 0
  9.       # 方向键下被按下的情况下
  10.       if Input.repeat?(Input::RIGHT)
  11.         # 光标向左移动
  12.         $game_system.se_play($data_system.cursor_se)
  13.         @index = (@index+1+@item_max) % @item_max if @item_max != 0
  14.         update_help
  15.       end
  16.       # 方向键上被按下的情况下
  17.       if Input.repeat?(Input::LEFT)
  18.         # 光标向右移动
  19.         $game_system.se_play($data_system.cursor_se)
  20.         @index = (@index-1+@item_max) % @item_max if @item_max != 0
  21.         update_help
  22.       end
  23.     end  
  24. #-------------------------------------------------------------------------
  25.     if self.active and @item_max >= 0 and @index >= 0
  26.       # 方向键下被按下的情况下
  27.       if Input.repeat?(Input::UP)
  28.         # 光标向左移动
  29.         $game_system.se_play($data_system.cursor_se)
  30.         @index = (@index+1+@item_max) / @item_max if @item_max != 0
  31.         update_help
  32.       end
  33.  
  34.       # 方向键上被按下的情况下
  35.       if Input.repeat?(Input::DOWN)
  36.         # 光标向右移动
  37.         $game_system.se_play($data_system.cursor_se)
  38.         @index = (@index-1+@item_max) / @item_max if @item_max != 0
  39.         update_help
  40.       end
  41. #-------------------------------------------------------------------------      
  42.     end
  43.  
  44.     # 刷新帮助文本 (update_help 定义了继承目标)
  45.     if @help_window != nil and @ajsdgfshfajklshfa == nil
  46.       update_help
  47.       update_help
  48.       @ajsdgfshfajklshfa = true
  49.     end
  50.  
  51.     # 刷新光标矩形
  52.     update_cursor_rect
  53.   end
  54.  
  55.  
  56.  
  57.   def now_selected_troop
  58.     return @all_fighters[@index]
  59.   end

1下一页.png (648.68 KB, 下载次数: 2)

1下一页.png
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-4-28 01:32

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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