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

Project1

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

[已经解决] 存档画面的分割

[复制链接]

Lv1.梦旅人

梦石
0
星屑
149
在线时间
59 小时
注册时间
2015-5-18
帖子
23
跳转到指定楼层
1
发表于 2015-7-15 00:10:08 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
存档画面的分割
想请教大大们
我想把存档画面的格式弄成像图片一样
请问该在Window_SaveFile加入什么
上网搜寻过了,自己也研究过了一会
请知道的大大帮帮忙,谢谢

评分

参与人数 1星屑 +35 收起 理由
RyanBern + 35 手动认可奖励

查看全部评分

Lv3.寻梦者

梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
帖子
1516
2
发表于 2015-7-15 09:33:41 | 只看该作者
本帖最后由 RyanBern 于 2015-7-15 10:31 编辑

RUBY 代码复制
  1. class Window_SaveFile
  2.   def initialize(file_index, filename)
  3.     super( file_index /2 *320 , 64 + file_index % 2 * 208, 320, 208)      #这一句是修改后的,实际上就是一个存档一个块,这是对一个块的设定
  4.     self.contents = Bitmap.new(width - 32, height - 32)
  5.     @file_index = file_index
  6.     @filename = "Save#{@file_index + 1}.rxdata"
  7.     @time_stamp = Time.at(0)
  8.     @file_exist = FileTest.exist?(@filename)
  9.     if @file_exist
  10.       file = File.open(@filename, "r")
  11.       @time_stamp = file.mtime
  12.       @characters = Marshal.load(file)
  13.       @frame_count = Marshal.load(file)
  14.       @game_system = Marshal.load(file)
  15.       @game_switches = Marshal.load(file)
  16.       @game_variables = Marshal.load(file)
  17.       @total_sec = @frame_count / Graphics.frame_rate
  18.       file.close
  19.     end
  20.     refresh
  21.     @selected = false
  22.   end
  23. end


另外
附带左右移动

RUBY 代码复制
  1. #==============================================================================
  2. # ■ Scene_File
  3. #------------------------------------------------------------------------------
  4. #  存档画面及读档画面的超级类。
  5. #==============================================================================
  6.  
  7. class Scene_File
  8.   #--------------------------------------------------------------------------
  9.   # ● 初始化对像
  10.   #     help_text : 帮助窗口显示的字符串
  11.   #--------------------------------------------------------------------------
  12.   def initialize(help_text)
  13.     @help_text = help_text
  14.   end
  15.   #--------------------------------------------------------------------------
  16.   # ● 主处理
  17.   #--------------------------------------------------------------------------
  18.   def main
  19.     # 生成帮助窗口
  20.     @help_window = Window_Help.new
  21.     @help_window.set_text(@help_text)
  22.     # 生成存档文件窗口
  23.     @savefile_windows = []
  24.     for i in 0..3
  25.       @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
  26.     end
  27.     # 选择最后操作的文件
  28.     @file_index = $game_temp.last_file_index
  29.     @savefile_windows[@file_index].selected = true
  30.     # 执行过渡
  31.     Graphics.transition
  32.     # 主循环
  33.     loop do
  34.       # 刷新游戏画面
  35.       Graphics.update
  36.       # 刷新输入信息
  37.       Input.update
  38.       # 刷新画面
  39.       update
  40.       # 如果画面被切换的话就中断循环
  41.       if $scene != self
  42.         break
  43.       end
  44.     end
  45.     # 准备过渡
  46.     Graphics.freeze
  47.     # 释放窗口
  48.     @help_window.dispose
  49.     for i in @savefile_windows
  50.       i.dispose
  51.     end
  52.   end
  53.   #--------------------------------------------------------------------------
  54.   # ● 刷新画面
  55.   #--------------------------------------------------------------------------
  56.   def update
  57.     # 刷新窗口
  58.     @help_window.update
  59.     for i in @savefile_windows
  60.       i.update
  61.     end
  62.     # 按下 C 键的情况下
  63.     if Input.trigger?(Input::C)
  64.       # 调用过程 on_decision (定义继承目标)
  65.       on_decision(make_filename(@file_index))
  66.       $game_temp.last_file_index = @file_index
  67.       return
  68.     end
  69.     # 按下 B 键的情况下
  70.     if Input.trigger?(Input::B)
  71.       # 调用过程 on_cancel (定义继承目标)
  72.       on_cancel
  73.       return
  74.     end
  75.     # 按下方向键下的情况下
  76.     if Input.repeat?(Input::DOWN)
  77.       # 方向键下的按下状态不是重复的情况下、
  78.       # 并且光标的位置在 3 以前的情况下
  79.       if Input.trigger?(Input::DOWN) or @file_index < 3
  80.         # 演奏光标 SE
  81.         $game_system.se_play($data_system.cursor_se)
  82.         # 光标向下移动
  83.         @savefile_windows[@file_index].selected = false
  84.         @file_index = (@file_index + 1) % 4
  85.         @savefile_windows[@file_index].selected = true
  86.         return
  87.       end
  88.     end
  89.     # 按下方向键上的情况下
  90.     if Input.repeat?(Input::UP)
  91.       # 方向键上的按下状态不是重复的情况下、
  92.       # 并且光标的位置在 0 以后的情况下
  93.       if Input.trigger?(Input::UP) or @file_index > 0
  94.         # 演奏光标 SE
  95.         $game_system.se_play($data_system.cursor_se)
  96.         # 光标向上移动
  97.         @savefile_windows[@file_index].selected = false
  98.         @file_index = (@file_index + 3) % 4
  99.         @savefile_windows[@file_index].selected = true
  100.         return
  101.       end
  102.     end
  103.        # 按下方向键下的情况下
  104.     if Input.repeat?(Input::LEFT)
  105.       # 方向键下的按下状态不是重复的情况下、
  106.       # 并且光标的位置在 3 以前的情况下
  107.       if Input.trigger?(Input::LEFT) or @file_index < 3
  108.         # 演奏光标 SE
  109.         $game_system.se_play($data_system.cursor_se)
  110.         # 光标向下移动
  111.         @savefile_windows[@file_index].selected = false
  112.         @file_index = (@file_index + 2) % 4
  113.         @savefile_windows[@file_index].selected = true
  114.         return
  115.       end
  116.     end
  117.     # 按下方向键上的情况下
  118.     if Input.repeat?(Input::RIGHT)
  119.       # 方向键上的按下状态不是重复的情况下、
  120.       # 并且光标的位置在 0 以后的情况下
  121.       if Input.trigger?(Input::RIGHT) or @file_index > 0
  122.         # 演奏光标 SE
  123.         $game_system.se_play($data_system.cursor_se)
  124.         # 光标向上移动
  125.         @savefile_windows[@file_index].selected = false
  126.         @file_index = (@file_index + 2) % 4
  127.         @savefile_windows[@file_index].selected = true
  128.         return
  129.       end
  130.     end
  131.   end
  132.   #--------------------------------------------------------------------------
  133.   # ● 生成文件名
  134.   #     file_index : 文件名的索引 (0~3)
  135.   #--------------------------------------------------------------------------
  136.   def make_filename(file_index)
  137.     return "Save#{file_index + 1}.rxdata"
  138.   end
  139. end






点评

非常感谢 已经解决了  发表于 2015-7-15 14:29

评分

参与人数 1梦石 +1 收起 理由
RyanBern + 1 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
9 小时
注册时间
2014-9-4
帖子
11
3
发表于 2015-8-18 21:19:12 | 只看该作者
感谢大大

点评

坟贴勿回,谢谢合作  发表于 2015-8-18 21:30
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-29 20:25

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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