赞 | 0 |
VIP | 18 |
好人卡 | 0 |
积分 | 1 |
经验 | 1277 |
最后登录 | 2015-3-14 |
在线时间 | 11 小时 |
Lv1.梦旅人 空靈
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 11 小时
- 注册时间
- 2006-7-27
- 帖子
- 521
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
這個是按shift截圖的。。想改成按F8截圖。。-A-順便想讓截圖存到自己新建的Pic文件下。。
- #============================================================================== #
- # Screenshot V2
- #
- # Screenshot Script v1 & screenshot.dll v1 created by: Andreas21
- # Screenshot Script v2 created/edit by: cybersam
- # the autor is found on a german board...
- # the comments are added by me...
- # since the autor didnt want to add any comment...
- # so thats it from here...
- # have fund with it... ^-^
- #
- # oh yea.. the needed command line is found in "Scene_Map" in "def update"
- #
- #===============================================================================
- module Screen
- @screen = Win32API.new 'screenshot', 'Screenshot', %w(l l l l p l l), ''
- @readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
- @findwindow = Win32API.new 'user32', 'FindWindowA', %w(p p), 'l'
- module_function
- #-----------------------------------------------------------------------------
- # here comes the stuff...
- # i add here the stuff for automatic change of the number for the screenshot
- # so it wont overrite the old one...
- # if you want to change so stuff change them in this line below
- # or you can change them in your command line... like
- # Screen::shot("screenshot", 2)
- # this change the name and the type of the screenshot
- # (0 = bmp, 1 = jpg and 2 = png)
- # ----------------------------------------------------------------------------
- def shot(file = "screenshot", typ = 2)
- # to add the right extension...
- if typ == 0
- typname = ".bmp"
- elsif typ == 1
- typname = ".jpg"
- elsif typ == 2
- typname = ".png"
- end
- file_index = 0
- dir = ""
- # make the filename....
- file_name = file.to_s + typname.to_s#dir + file.to_s + typname.to_s
- # make the screenshot.... Attention dont change anything from here on....
- @screen.call(0,0,640,480,file_name,handel,typ)
- end
- # find the game window...
- def handel
- game_name = "\0" * 256
- @readini.call('Game','Title','',game_name,255,".\\Game.ini")
- game_name.delete!("\0")
- return @findwindow.call('RGSS Player',game_name)
- end
- end
- #==============================================================================
- # ■ Graphics
- #------------------------------------------------------------------------------
- # 進行有關全體圖像處理的模塊。
- #==============================================================================
- class << Graphics
- alias old_update update
- #--------------------------------------------------------------------------
- # ● 更新畫面
- #--------------------------------------------------------------------------
- def update
- if Input.press?(Input::SHIFT)
- timestamp = Time.now.strftime("%Y%m%d%H%M")
- se = Time.now.sec
- Screen::shot("#{timestamp}#{se}", 2)
- end
- old_update
- end
- end
复制代码 版务信息:本贴由楼主自主结贴~ |
|