查看: 1929|回复: 1

[已经解决] 【已解决】如何让光标第四个就往标记的5走

[复制链接]
梦石
0
星屑
7296
在线时间
1244 小时
注册时间
2015-8-15
回帖
473
发表于 2023-4-11 16:28:57 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 金芒芒 于 2023-4-11 21:23 编辑

[pre lang="ruby"]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

    @right.x = self.x+72+self.top_column.to_f*66.0*(4*66)/(@item_max.to_f*66)

    # 计算光标的宽度
    cursor_width = 1200
    # 计算光标坐标
    x =32+ @index*66 - self.ox-1# 8 #
    y = 4 #@index*20 - self.oy-1
    # 更新光标矩形
    self.cursor_rect.set(x, y, 66 ,80)
  end[/pre]
4-5.png
梦石
0
星屑
7296
在线时间
1244 小时
注册时间
2015-8-15
回帖
473
 楼主| 发表于 2023-4-11 21:21:40 | 显示全部楼层
  1.     cursor_width = 1200
  2.     # 计算光标坐标
  3. #   x = 4 + index % 2 * (288 + 32)
  4.   #  y = index / 2 * 32
  5.   #x =32+ @index*66 - self.ox-1# 8 #
  6.      x =16 +@index% 4 * (66 + 5)
  7.      y = @index/ 4 * 88
  8.     #y = 14 #@index*20 - self.oy-1
  9.     # 更新光标矩形
  10.     self.cursor_rect.set(x, y, 66 ,80)
  11.   end
复制代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部