设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1583|回复: 1
打印 上一主题 下一主题

[已经解决] 小问题请教:filename何用?及at

[复制链接]

Lv1.梦旅人

梦石
0
星屑
49
在线时间
157 小时
注册时间
2013-8-14
帖子
203
跳转到指定楼层
1
发表于 2013-8-29 16:28:45 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
Window_SaveFile
RUBY 代码复制
  1. #--------------------------------------------------------------------------
  2.   # ● 初始化对像
  3.   #     file_index : 存档文件的索引 (0~3)
  4.   #     filename   : 文件名
  5.   #--------------------------------------------------------------------------
  6.   def initialize(file_index, filename)
  7.     super(0, 64 + file_index % 4 * 104, 640, 104)
  8.     self.contents = Bitmap.new(width - 32, height - 32)
  9.     @file_index = file_index
  10.     @filename = "Save#{@file_index + 1}.rxdata"
  11.     @time_stamp = Time.at(0)
  12.     @file_exist = FileTest.exist?(@filename)
  13.     if @file_exist
  14.       file = File.open(@filename, "r")
  15.       @time_stamp = file.mtime
  16.       @characters = Marshal.load(file)
  17.       @frame_count = Marshal.load(file)
  18.       @game_system = Marshal.load(file)
  19.       @game_switches = Marshal.load(file)
  20.       @game_variables = Marshal.load(file)
  21.       @total_sec = @frame_count / Graphics.frame_rate
  22.       file.close
  23.     end
  24.     refresh
  25.     @selected = false
  26.   end



问题 :
1. def initialize(file_index, filename) 的参数filename 到处找不着引用他的地方...请问设置filename 参数有啥用?...
2. 请问@time_stamp = Time.at(0) 的at(0) 的意思


另外...
Scene_File
RUBY 代码复制
  1. #--------------------------------------------------------------------------
  2.   # ● 主处理
  3.   #--------------------------------------------------------------------------
  4.   def main
  5.     # 生成帮助窗口
  6.     @help_window = Window_Help.new
  7.     @help_window.set_text(@help_text)
  8.     # 生成存档文件查
  9.     @savefile_windows = []
  10.     for i in 0..3
  11.       @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
  12.     end

filename 参数是make_filename(i)

Lv1.梦旅人

梦石
0
星屑
112
在线时间
551 小时
注册时间
2012-8-18
帖子
1429
2
发表于 2013-8-29 16:36:29 | 只看该作者
filename看样子是没用……orz
至于Time.at 这个F1里面没有 需要参考 http://www.kuqin.com/rubycndocument/index.html 的内部类-Time

点评

谢了  发表于 2013-8-29 18:22

评分

参与人数 2星屑 +112 收起 理由
︶ㄣ牛排ぶ + 100 认可答案
orzfly + 12 无脑儿塞糖

查看全部评分

我要填坑!我要背单词!我要学日语!我要每天锻炼!
好吧呵呵= =
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-26 06:51

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表