查看: 1595|回复: 2

做菜单画面时发生的奇怪问题(关于矩形光标)

  [复制链接]
梦石
0
星屑
50
在线时间
82 小时
注册时间
2006-1-28
回帖
852
发表于 2007-9-6 20:22:34 | 显示全部楼层 |阅读模式

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

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

×
#--------------------------------------------------------------------------
  # ● 刷新光标矩形
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    end  
    if @index > 1
      self.cursor_rect.set((@index-2)*248+120, 184, 150, 55)
    else
      #self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
      self.cursor_rect.set(@index*248+120, 54, 150, 55)
    end
  end
end

为什么增加了光标的长度(原来是110,增加到150后出现),就会在菜单画面一开始出现很奇怪的光标.不知道是什么原因,请帮忙解决一下,谢谢了
梦石
0
星屑
50
在线时间
82 小时
注册时间
2006-1-28
回帖
852
发表于 2007-9-6 20:22:34 | 显示全部楼层 |阅读模式

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

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

×
#--------------------------------------------------------------------------
  # ● 刷新光标矩形
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    end  
    if @index > 1
      self.cursor_rect.set((@index-2)*248+120, 184, 150, 55)
    else
      #self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
      self.cursor_rect.set(@index*248+120, 54, 150, 55)
    end
  end
end

为什么增加了光标的长度(原来是110,增加到150后出现),就会在菜单画面一开始出现很奇怪的光标.不知道是什么原因,请帮忙解决一下,谢谢了
梦石
0
星屑
431
在线时间
125 小时
注册时间
2006-11-2
回帖
1177
发表于 2007-9-6 23:34:12 | 显示全部楼层
self.cursor_rect.set(@index*248+120, 54, 150, 55)

当 @index = -1 的时候  -248 + 120 < 150 所以多出的部分就出来了
把248改成 270以上就行了。。
和记忆一起封存着的ID...
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部