累计送礼: 0 个 累计收礼: 1 个 TA的每日心情 开心 2026-7-12 04:10
签到天数: 209 天
连续签到: 2 天
[LV.7]常住居民III
管理员
VIP
7
卡币
58883
OK点
16
推广点
0
同能卷
50
积分 68848
PrintScreen Screenshot+ 2012/06/10
Creator name: Ru/むっくRu (Rutan) | (English Translation by tale)
Introduction
A script that lets you save a screenshot of the game screen by pressing PrintScreen.
Features
- Press PrintScreen to save the screenshot inside the project folder of RPGVXAce
- Adds a function to save a screenshot of the game screen
- Screens are located inside screenshot folder
For more details, see the item settings in the script.
Screen
I didn't create a new folder and rename it "screenshot" and go on paint to make these two screens.
That's the script doing the work with the convenience of the PrintScreen key.
How to Use
Paste this script above Main.
Script link
https://raw.githubusercontent.com/ovate/torigoya-rgss3/main/torigoya_PrintScreen.rb
Code:
# coding: utf-8 #=============================================================================== # ■ PrintScreen Screenshot for RGSS3 #------------------------------------------------------------------------------- # 2012/06/10 Ru/むっくRu (Rutan) | English translation by tale 2017/02/12 # License - Public Domain, allows commercial use and credit is not necessary #------------------------------------------------------------------------------- # Press PrintScreen to save the screenshot inside the project folder "screenshot" # Adds a function to save a screenshot of the game screen # (Countermeasures against lag, screens are created after several seconds) #------------------------------------------------------------------------------- # 【Issues】 # Game frame rate drops a bit during saving #------------------------------------------------------------------------------- # 【Changelogs】 # 2012/06/10 Fixed an issue that causes force quit when pressing F12 during save. # 2012/01/07 Fixed a bug where it doesn't work well during battle? # 2011/12/27 Release #------------------------------------------------------------------------------- # 【Reference:PNG file processing】 # http://d.hatena.ne.jp/ku-ma-me/20091003/p1 #------------------------------------------------------------------------------- #=============================================================================== # ● Item settings #=============================================================================== module HZM_VXA module ScreenShot # Name of the folder DIRNAME = 'screenshot' # File name to be saved.No extension(.png)required # %Y …… Year # %m …… Month(01-12) # %d …… Day(01-31) # %H …… Hour(00-23) # %M …… Minute(00-59) # %S …… Second(00-59) FILENAME = "%Y%m%d_%H%M%S" # Display texts on the screenshot # true …… On # false …… Off USE_COPYRIGHT = false # Texts shown in the screen COPYRIGHT_TEXT = '(C) birdhouse.txt' # Text's color COPYRIGHT_COLOR = Color.new(255, 255, 255) # Text's size COPYRIGHT_SIZE = 16 # Text's position (0: Left, 1: Center, 2: Right) COPYRIGHT_ALIGN = 2 # Number of times to process 1 frame # ※Increasing the value will shorten the process of generating the file, # Amount of load time increases when the processing dramatically drops RUN_SPEED = 3 end end #=============================================================================== # ↑ Setup goes here ↑ # ↓ for less, script there ↓ #=============================================================================== module HZM_VXA module ScreenShot VK_SNAPSHOT = 0x2c GetKeyState = Win32API.new('user32', 'GetKeyState', %w(l), 'i') #--------------------------------------------------------------------------- # ● Startup #--------------------------------------------------------------------------- def self.init @pressed = false @list = [] end #--------------------------------------------------------------------------- # ● Update #--------------------------------------------------------------------------- def self.update add if press? RUN_SPEED.times { develop } end #--------------------------------------------------------------------------- # ● PrintScreen monitor #--------------------------------------------------------------------------- def self.press? if @pressed @pressed = (GetKeyState.call(VK_SNAPSHOT) < 0) false else @pressed = (GetKeyState.call(VK_SNAPSHOT) < 0) end end #--------------------------------------------------------------------------- # ● Addition to development waiting #--------------------------------------------------------------------------- def self.add bitmap = Graphics.snap_to_bitmap if USE_COPYRIGHT bitmap.font.size = COPYRIGHT_SIZE bitmap.font.color = COPYRIGHT_COLOR bitmap.draw_text(0, bitmap.height - COPYRIGHT_SIZE, bitmap.width, COPYRIGHT_SIZE, COPYRIGHT_TEXT, COPYRIGHT_ALIGN) end filename = "#{Time.now.getlocal.strftime(FILENAME)}" @list.push({ :bitmap => bitmap, :filename => filename }) end #--------------------------------------------------------------------------- # ● Development #--------------------------------------------------------------------------- def self.develop return if @list.empty? data = @list.first if data[:line] == nil # Unconditional data[:line] = 0 data[:img] = [] elsif data[:line] < data[:bitmap].height # Analyzing data[:img].push 0 for i in 0...data[:bitmap].width c = data[:bitmap].get_pixel(i, data[:line]) data[:img].push(c.red, c.green, c.blue) end data[:line] += 1 else # Saving Dir.mkdir(DIRNAME) unless File.exist?(DIRNAME) cnt = Dir.glob("#{DIRNAME}/#{data[:filename]}*.png").size footer = cnt > 0 ? "_#{cnt}" : "" File.open("#{DIRNAME}/#{data[:filename]}#{footer}.png", 'wb') do |file| file.write "\x89PNG\r\n\x1a\n" file.write createChunk('IHDR', [data[:bitmap].width, data[:bitmap].height, 8, 2, 0, 0, 0].pack('N2C5')) file.write createChunk('IDAT', Zlib::Deflate.deflate(data[:img].pack('C*'))) file.write createChunk('IEND', '') end data[:bitmap].dispose @list.shift end end #--------------------------------------------------------------------------- # ● Create PNG chunk data #--------------------------------------------------------------------------- def self.createChunk(type, data) [data.bytesize, type, data, Zlib.crc32(type + data)].pack('NA4A*N') end end end class Scene_Base #----------------------------------------------------------------------------- # ● Screenshot update #----------------------------------------------------------------------------- alias hzm_vxa_screenshot_update_basic update_basic def update_basic hzm_vxa_screenshot_update_basic HZM_VXA::ScreenShot.update end end class << SceneManager #----------------------------------------------------------------------------- # ● Execution #----------------------------------------------------------------------------- alias hzm_vxa_screenshot_run run def run HZM_VXA::ScreenShot.init hzm_vxa_screenshot_run end end 复制代码
Credit and Thanks
- Original Author: Rutan
- English translation: tale
License - Public Domain, this means commercial use is allow and credit is not necessary
Source
https://torigoya.hatenadiary.jp/entry/20111221/rgss3
本贴来自国际rpgmaker官方论坛作者:ovate处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/printscreen-screenshot.74832/
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x