扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 123|回复: 0

[转载发布] 发个战斗前截取当前地图当背景的脚本

[复制链接]
累计送礼:
0 个
累计收礼:
0 个
  • TA的每日心情
    开心
    昨天 16:47
  • 签到天数: 113 天

    连续签到: 3 天

    [LV.6]常住居民II

    2338

    主题

    400

    回帖

    1万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    6
    卡币
    10580
    OK点
    16
    推广点
    0
    同能卷
    0
    积分
    13346

    灌水之王

    发表于 2024-4-18 18:52:50 | 显示全部楼层 |阅读模式
    随便发着玩。。。不需要神马精华啥的了,毕竟都是古董了。。。国外的东东。。。附件内是调用的dll
    RUBY 代码
    1. #===============================================================================
    2. #
    3. # Screenshot V2
    4. #
    5. # Screenshot Script v1 & screenshot.dll v1            created by: Andreas21
    6. # Screenshot Script v2                                created/edit by: cybersam
    7. # the autor is found on a german board...
    8. # the comments are added by me...
    9. # since the autor didnt want to add any comment...
    10. # so thats it from here...
    11. # have fund with it... ^-^
    12. #
    13. # oh yea.. the needed command line is found in "Scene_Map" in "def update"
    14. #
    15. #===============================================================================
    16. module Screen  
    17.   @screen = Win32API.new'screenshot', 'Screenshot', %w(l l l l p l l), ''
    18.   @readini = Win32API.new'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
    19.   @findwindow = Win32API.new'user32', 'FindWindowA', %w(p p), 'l'
    20.   module_function
    21.   #-----------------------------------------------------------------------------
    22.   # here comes the stuff...
    23.   # i add here the stuff for automatic change of the number for the screenshot
    24.   # so it wont overrite the old one...
    25.   # if you want to change so stuff change them in this line below
    26.   # or you can change them in your command line... like
    27.   # Screen::shot("screenshot", 2)
    28.   # this change the name and the type of the screenshot
    29.   # (0 = bmp, 1 = jpg and 2 = png)
    30.   # ----------------------------------------------------------------------------
    31.   def shot(file = "screenshot", typ = 1)
    32.     # to add the right extension...
    33.     if typ == 0
    34.       typname = ".bmp"
    35.     elsif typ == 1
    36.       typname = ".jpg"
    37.     elsif typ == 2
    38.       typname = ".png"
    39.     end   
    40.     file_index = 0   
    41.     dir = "Graphics/Battlebacks/"   
    42.     # make the filename....
    43.     file_name = dir + file.to_s + typname.to_s   
    44.     # make the screenshot.... Attention dont change anything from here on....
    45.     @screen.call(0,0,640,480,file_name,handel,typ)
    46.   end
    47.   # find the game window...
    48.   def handel
    49.     game_name = "\0" * 256
    50.     @readini.call('Game','Title','',game_name,255,".\\Game.ini")
    51.     game_name.delete!("\0")
    52.     return@findwindow.call('RGSS Player',game_name)
    53.   end
    54. end
    复制代码


                本帖来自P1论坛作者ikki,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=342060  若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2025-3-14 14:25 , Processed in 0.109180 second(s), 58 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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