设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 109|回复: 0

[转载发布] FG7 - Easy Pause Screen

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58883
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68848

    灌水之王

    发表于 2026-8-2 18:54:19 | 显示全部楼层 |阅读模式
    Easy Pause Screen
    By: FamilyGamer7

    Introduction
                            Quick and easy way to implement a pause screen script. The script leverages the power of $game_switches to perform its action.               
    Click to expand...


    Features
                            The ability to change the - Pause Button / Pause Screen Picture / Game Switch to help fuel the Pause Screen script. Ideally provides more flexibility than using a static variable created within a defined method.               
    Click to expand...


    Screenshots
                            - Not Needed -               
    Click to expand...


    Script
    Spoiler: FG7 - Easy Pause Screen
                    Ruby:       
    1. #==============================================================================
    2. # Title: Easy Pause Screen
    3. # Author: FamilyGamer7 (FG7)
    4. # Version: 1.0
    5. # Engine: RPG Maker VX Ace
    6. #==============================================================================
    7. # ** Change Log |
    8. # ---------------
    9. # 1.0 => Created Script
    10. #==============================================================================
    11. # ** Description |
    12. # ----------------
    13. # Quick and easy way to implement a pause screen script. The script leverages
    14. # the power of $game_switches to perform its action.
    15. #==============================================================================
    16. # ** Terms of Use |
    17. # -----------------
    18. # * Free to use in non-commercial projects and commercial projects
    19. # * Feel free to modify and improve the script. Credit is still required.
    20. # * Credit FamilyGamer7
    21. #==============================================================================
    22. # ** Usage |
    23. # ----------
    24. # - The "Pause_Button" allows you to change any key for the triger to pause
    25. #   the screen.
    26. #
    27. # - The "Pause_Screen_Picture" allows you to specify the name of the image you
    28. #   want to use once the game is paused.
    29. #
    30. # - The "Game_Switch_Number" allows to set any number value for the game switch
    31. #   that is being used. Ideally provides more flexibility than using a static
    32. #   variable created within a defined method.
    33. #==============================================================================
    34. # ** Notes |
    35. # ----------
    36. # The Pause screen is designed to not work with the Title Screen (Scene_Title).
    37. # The script also stops the playtime count when the pause screen is active.
    38. #
    39. # List of Keys: /  :A :B :C :X :Y :Z :L :R :F5 :F6 :F7 :F8 :F9
    40. #               /   :DOWN :LEFT :RIGHT :UP :SHIFT :CTRL :ALT
    41. #==============================================================================
    42. #==============================================================================
    43. # ** Module: FG7::Easy_Pause_Screen
    44. #------------------------------------------------------------------------------
    45. #  This modules creates a static variable to be used within the script.
    46. #==============================================================================
    47. module FG7
    48.   module Easy_Pause_Screen
    49. #==============================================================================
    50. # -------------------- ALLOWED TO EDIT BELOW THIS LINE ---------------------- #
    51. #==============================================================================
    52.     # Sets the pause button used to trigger the game frozen/paused
    53.     Pause_Button = :X
    54.     # Sets the pause background used once the pause is triggered
    55.     # (Image to be placed in "Graphic/Pictures/" folder)
    56.     Pause_Screen_Picture = "Pause_Background"
    57.     # Sets the game switch number used for triggering the pause action
    58.     Game_Switch_Number = 19
    59. #==============================================================================
    60. # ---------- DO NOT EDIT BELOW THIS LINE (FOR ADVANCED USERS) --------------- #
    61. #==============================================================================
    62.   end
    63. end
    64. #==============================================================================
    65. # ** Game_System
    66. #------------------------------------------------------------------------------
    67. #  This class handles system data. It saves the disable state of saving and
    68. # menus. Instances of this class are referenced by $game_system.
    69. #==============================================================================
    70. class Game_System
    71.   #--------------------------------------------------------------------------
    72.   # * New Method: update_pause (Checks if pause has been triggered)
    73.   #--------------------------------------------------------------------------
    74.   def update_pause
    75.     # Add current frame count into count variable
    76.     @update_frame_count = Graphics.frame_count
    77.     # Creates Pause Picture bitmap to overlay on screen once pause is triggered
    78.     # (The "z" value ensure nothing is above the pause screen)
    79.     @pause_screen_pic = Sprite.new
    80.     @pause_screen_pic.bitmap = Cache.picture(FG7::Easy_Pause_Screen::Pause_Screen_Picture)
    81.     @pause_screen_pic.z = 5000
    82.     # If the game switch is not met - do a "return"
    83.     return @pause_screen_pic.dispose if $game_switches[FG7::Easy_Pause_Screen::Game_Switch_Number] != true
    84.     # Loop and break if game switch is not met and properly unpauses screen
    85.     loop do
    86.       # Checks if the game switch is not met within the loop to dispose image
    87.       if $game_switches[FG7::Easy_Pause_Screen::Game_Switch_Number] != true
    88.         @pause_screen_pic.dispose
    89.       end
    90.       # Breaks if the game switch is not met and updates screen to normal
    91.       break if $game_switches[FG7::Easy_Pause_Screen::Game_Switch_Number] != true
    92.       $game_switches[FG7::Easy_Pause_Screen::Game_Switch_Number] = $game_switches[FG7::Easy_Pause_Screen::Game_Switch_Number] == true ? false : true if Input.trigger?(FG7::Easy_Pause_Screen::Pause_Button)
    93.       # Add count variable back into frame count
    94.       Graphics.frame_count = @update_frame_count
    95.       # Re-update Input & Graphics
    96.       Input.update
    97.       Graphics.update
    98.     end
    99.   end
    100. end
    101. #==============================================================================
    102. # ** Scene_Base
    103. #------------------------------------------------------------------------------
    104. #  This is a super class of all scenes within the game.
    105. #==============================================================================
    106. class Scene_Base
    107.   #--------------------------------------------------------------------------
    108.   # * Alias Method: Frame Update
    109.   #--------------------------------------------------------------------------
    110.   alias :fg7_easy_pause_screen_update :update
    111.   def update
    112.     fg7_easy_pause_screen_update
    113.     # Performs the updating of the pause screen if conditions are met
    114.     # (Pause is not performed on the on Title Screen)
    115.     if !SceneManager::scene_is?(Scene_Battle) && !SceneManager::scene_is?(Scene_Title)
    116.       $game_system.update_pause
    117.       $game_switches[FG7::Easy_Pause_Screen::Game_Switch_Number] = $game_switches[FG7::Easy_Pause_Screen::Game_Switch_Number] == true ? false : true if Input.trigger?(FG7::Easy_Pause_Screen::Pause_Button)
    118.     end
    119.   end
    120. end
    121. #==============================================================================
    122. # ** Scene_Battle
    123. #------------------------------------------------------------------------------
    124. #  This class performs battle screen processing.
    125. #==============================================================================
    126. class Scene_Battle < Scene_Base
    127.   #--------------------------------------------------------------------------
    128.   # * Alias Method: Update Frame (Basic)
    129.   #--------------------------------------------------------------------------
    130.   alias :fg7_easy_pause_screen_update_basic :update_basic
    131.   def update_basic
    132.     fg7_easy_pause_screen_update_basic
    133.     # Performs the updating of the pause screen if conditions are met
    134.     $game_system.update_pause
    135.     $game_switches[FG7::Easy_Pause_Screen::Game_Switch_Number] = $game_switches[FG7::Easy_Pause_Screen::Game_Switch_Number] == true ? false : true if Input.trigger?(FG7::Easy_Pause_Screen::Pause_Button)
    136.   end
    137. end
    复制代码


    How to Use
                            Add this script in the script editor under in the "Materials" section and above "Main Process".
    The instructions and setup for the script are held within the script header itself. No need to repeat here.               
    Click to expand...


    Terms of Use
                            - Free to use in non-commercial projects and commercial projects
    - Feel free to modify and improve the script. Credit is still required.
    - Credit FamilyGamer7               
    Click to expand...




    本贴来自国际rpgmaker官方论坛作者:FG7处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/fg7-easy-pause-screen.144477/
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

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

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-17 09:31 , Processed in 0.136681 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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