赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 8217 |
最后登录 | 2024-9-14 |
在线时间 | 68 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 120
- 在线时间
- 68 小时
- 注册时间
- 2007-12-16
- 帖子
- 75
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
这是RMVX的$game_temp.background_bitmap(Graphics.snap_to_bitmap)
加上 柳之一 的 快速存储Bitmap的Marshal
制成的RMVX最新截图存档
截图
范例
http://rpg.blue/upload_program/files/PicSave_93287510.rar
原始脚本
- #==============================================================================
- # ■ 最新截圖存檔 For RMVX By 釣到一隻猴子@_@ ── AAM@_@
- # Ver.1.0.0.000
- #
- # 感謝:柳之一
- #==============================================================================
- #==============================================================================
- # ■ 快速存儲Bitmap的Marshal By 柳之一
- #==============================================================================
- class Bitmap
- # 传送到内存的API函数
- RtlMoveMemory_pi = Win32API.new('kernel32', 'RtlMoveMemory', 'pii', 'i')
- RtlMoveMemory_ip = Win32API.new('kernel32', 'RtlMoveMemory', 'ipi', 'i')
- def _dump
- data = "rgba" * width * height
- RtlMoveMemory_pi.call(data, address, data.length)
- [width, height, Zlib::Deflate.deflate(data)].pack("LLa*") # 压缩
- end
- def self._load(str)
- w, h, zdata = str.unpack("LLa*"); b = new(w, h)
- RtlMoveMemory_ip.call(b.address, Zlib::Inflate.inflate(zdata), w * h * 4); b
- end
- # [[[bitmap.object_id * 2 + 16] + 8] + 16] == 数据的开头
- #
- def address
- buffer, ad = "xxxx", object_id * 2 + 16
- RtlMoveMemory_pi.call(buffer, ad, 4); ad = buffer.unpack("L")[0] + 8
- RtlMoveMemory_pi.call(buffer, ad, 4); ad = buffer.unpack("L")[0] + 16
- RtlMoveMemory_pi.call(buffer, ad, 4); return buffer.unpack("L")[0]
- end
- end
- #==============================================================================
- # ■ Window_SaveFile
- #------------------------------------------------------------------------------
- # 显示存档以及读档画面、保存文件的窗口。
- #==============================================================================
- class Window_SaveFile < Window_Base
- #--------------------------------------------------------------------------
- # ● 定义实例变量
- #--------------------------------------------------------------------------
- attr_reader :pic_str
- #--------------------------------------------------------------------------
- # ● 初始化对象
- # file_index : 存档文件索引 (0~3)
- # filename : 文件名
- #--------------------------------------------------------------------------
- alias sbs_aam_picsavevx1_old_initialize initialize
- def initialize(file_index, filename)
- @pic_str = nil
- sbs_aam_picsavevx1_old_initialize(file_index, filename)
- end
- #--------------------------------------------------------------------------
- # ● 读取部分游戏数据
- # 开关以及变量为默认则是未使用 (为表示地名而扩展) 。
- #--------------------------------------------------------------------------
- alias sbs_aam_picsavevx1_old_load_gamedata load_gamedata
- def load_gamedata
- if FileTest.exist?(@filename)
- file = File.open(@filename, "r")
- begin
- pic_str = Marshal.load(file)
- @pic_str = pic_str
- rescue
- @pic_str = nil
- ensure
- file.close
- end
- end
- sbs_aam_picsavevx1_old_load_gamedata
- end
- end
- #==============================================================================
- # ■ Scene_File
- #------------------------------------------------------------------------------
- # 处理文件的类。
- #==============================================================================
- class Scene_File < Scene_Base
- #--------------------------------------------------------------------------
- # ● 生成存档文件窗口
- #--------------------------------------------------------------------------
- alias sbs_aam_picsavevx1_old_create_savefile_windows create_savefile_windows
- def create_savefile_windows
- @savefile_sprite = Sprite.new
- @savefile_sprite.bitmap = Bitmap.new(1, 1)
- sbs_aam_picsavevx1_old_create_savefile_windows
- end
- #--------------------------------------------------------------------------
- # ● 释放存档文件
- #--------------------------------------------------------------------------
- alias sbs_aam_picsavevx1_old_dispose_item_windows dispose_item_windows
- def dispose_item_windows
- @savefile_sprite.dispose
- sbs_aam_picsavevx1_old_dispose_item_windows
- end
- #--------------------------------------------------------------------------
- # ● 更新存档文件窗口
- #--------------------------------------------------------------------------
- alias sbs_aam_picsavevx1_old_update_savefile_windows update_savefile_windows
- def update_savefile_windows
- @savefile_sprite.update
- sbs_aam_picsavevx1_old_update_savefile_windows
- end
- #--------------------------------------------------------------------------
- # ● 更新存档文件选择
- #--------------------------------------------------------------------------
- alias sbs_aam_picsavevx1_old_update_savefile_selection update_savefile_selection
- def update_savefile_selection
- sbs_aam_picsavevx1_old_update_savefile_selection
- if !@savefile_windows[@index].pic_str.nil?
- str = @savefile_windows[@index].pic_str
- @savefile_sprite.bitmap = Bitmap._load(str)
- @help_window.back_opacity = 50
- for window in @savefile_windows
- window.back_opacity = 50
- end
- else
- @savefile_sprite.bitmap = Bitmap.new(1, 1)
- @help_window.back_opacity = 200
- for window in @savefile_windows
- window.back_opacity = 200
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 写入存档数据
- # file : 写入文件用对象 (已经打开)
- #--------------------------------------------------------------------------
- alias sbs_aam_picsavevx1_old_write_save_data write_save_data
- def write_save_data(file)
- pic_str = $game_temp.background_bitmap._dump
- Marshal.dump(pic_str, file)
- sbs_aam_picsavevx1_old_write_save_data(file)
- end
- end
- #==============================================================================
- # ■ 最新截圖存檔 For RMVX By 釣到一隻猴子@_@ ── AAM@_@
- #==============================================================================
复制代码 |
|