查看: 1808|回复: 2

[已经过期] 窗口类脚本的光标

[复制链接]
梦石
0
星屑
50
在线时间
1281 小时
注册时间
2006-8-27
回帖
550
发表于 2010-10-12 17:49:12 | 显示全部楼层 |阅读模式

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

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

×
窗口类中画光标的用 self.cursor_rect.set(x, y, width, height)

我理解为:
Window中定义了某变量(Rect.new)
def cursor_rect
  return 某变量
end

刷新时根据某变量的4属性来描绘

但实际运用中发现 描绘要在刷新前
也就是 self.cursor_rect.set的时候就执行描绘
这样的类不清楚是怎么写的.

酱油的

梦石
0
星屑
1840
在线时间
2161 小时
注册时间
2007-12-22
回帖
3216

贵宾

发表于 2010-10-13 04:08:48 | 显示全部楼层
initialize嘛 = = 貌似window_help 就是這樣的。毋論你是否需要刷新,總之在連接 help 的時候都會強行把 help window 刷新一次。就是這樣……
不做頭像做簽名,看我囧冏有神(多謝山人有情提供 )
回复

使用道具 举报

梦石
0
星屑
50
在线时间
1281 小时
注册时间
2006-8-27
回帖
550
 楼主| 发表于 2010-10-13 17:53:53 | 显示全部楼层
是不一样的
  1.   #--------------------------------------------------------------------------
  2.   # ● 帮助窗口的设置
  3.   #     help_window : 新的帮助窗口
  4.   #--------------------------------------------------------------------------
  5.   def help_window=(help_window)
  6.     @help_window = help_window
  7.     # 刷新帮助文本 (update_help 定义了继承目标)
  8.     if self.active and @help_window != nil
  9.       update_help
  10.     end
  11.   end
复制代码
help_window 可以用这个 help_window=(help_window) 来建立的时候刷新文本

self.cursor_rect.set(x, y, width, height) 要如何做到?

def cursor_rect.set(x, y, width, height)
end  显然不行



点评

表示小生的做法是通过按键判断来描光标,虽说有些麻烦.....  发表于 2010-10-13 18:43
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部