| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 0 |
| 经验 | |
| 最后登录 | 2015-7-19 |
| 在线时间 | 157 小时 |
- 梦石
- 0
- 星屑
- 49
- 在线时间
- 157 小时
- 注册时间
- 2013-8-14
- 回帖
- 155
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 九靈 于 2013-8-29 18:24 编辑
Window_SaveFile
[pre lang="ruby" line="39"] #--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# 描绘文件编号
self.contents.font.color = normal_color
name = "文件 #{@file_index + 1}"
self.contents.draw_text(4, 0, 600, 32, name)
@name_width = contents.text_size(name).width
[/pre]
就这句@name_width = contents.text_size(name).width
问题 :
1. contents是变量还是方法?
2. 若是方法,返回值是@contents吗?(似乎是直接从Window调用)
还是Bitmap.new时赋得值?(不过...是赋给self.contents)
3. contents指的是什么? (问到脑袋不清楚了= =)
Window_SaveFile
[pre lang="ruby" line="18"] def initialize(file_index, filename)
super(0, 64 + file_index % 4 * 104, 640, 104)
self.contents = Bitmap.new(width - 32, height - 32)
[/pre]
self.contents生成
|
|