| 
 
| 赞 | 89 |  
| VIP | 350 |  
| 好人卡 | 311 |  
| 积分 | 103 |  
| 经验 | 150139 |  
| 最后登录 | 2024-6-24 |  
| 在线时间 | 5019 小时 |  
 Lv4.逐梦者 (版主) 无限の剣制 
	梦石0 星屑10301 在线时间5019 小时注册时间2013-2-28帖子5030  
 | 
| 做法很简单,生成窗口时不要激活窗口。 然后判断鼠标是否在窗口的内部,如果在则激活窗口,否则冻结窗口。这里给个例子
 复制代码class Window_VIPArcher < Window_Command
  #----------------------------------------------------------------------------
  #  初始化
  #----------------------------------------------------------------------------
  def initialize
    super
    self.deactivate
  end
  #----------------------------------------------------------------------------
  #   判断是否在范围内  Mouse 鼠标模块 
  #----------------------------------------------------------------------------
  def in_the_range?
    Mouse.x > x && Mouse.x < x + width && Mouse.y > y && Mouse.y < y + height
  end
  #----------------------------------------------------------------------------
  #   更新画面
  #----------------------------------------------------------------------------
  def update
    super
    self.active = in_the_range?
  end
end
 | 
 评分
查看全部评分
 |