Quantcast
Channel: RGSS3 Scripts (RMVX Ace) Latest Topics
Viewing all articles
Browse latest Browse all 416

Pause Screen (In & Out of Battle)

$
0
0

Introduction

This will allow you to pause the game in and out of battle by the press of a button.

 

Script

#==============================================================================#                        Pause Screen by Z3R0X505#------------------------------------------------------------------------------# Allows you to pause the game in battle and on the map using a set button.#==============================================================================# Terms of Use: May be used for commercial and non-commercial as long as I am#               properly credited.#==============================================================================module Pause_Screen  #Button used to call and cancel the pause screen.  Pause_Input = Input::F8       #Default F8    #SE to be played when triggered.  Pause_SE = "Decision2"  Pause_SE_Volume = 100  Pause_SE_Pitch = 100    #BGM to be played while paused.  Pause_BGM = "Dungeon7"  Pause_BGM_Volume = 100  Pause_BGM_Pitch = 100    #Picture used as the pause screen located in Graphic/Pictures/ folder.  Pause_Pic = "Pause"    #Allow pause in battle?  Allow_IN_Battle = true  Allow_ON_Map = trueend#========================= Don't edit past here ===============================class Game_Temp  attr_accessor :paused                alias pause_init initialize  def initialize    @paused = false    pause_init  endendmodule Game_Pause_Screen    include Pause_Screen  def update_pause    update_pausing    update_pause_input        end             def update_pause_input    if SceneManager.scene_is?(Scene_Battle)      if Allow_IN_Battle == true        check_if_paused if Input.trigger?(Pause_Screen::Pause_Input)      end    elsif SceneManager.scene_is?(Scene_Map)      if Allow_ON_Map == true        check_if_paused if Input.trigger?(Pause_Screen::Pause_Input)      end    end  end                      def check_if_paused    Audio.se_play("Audio/SE/" + Pause_SE,Pause_SE_Volume,Pause_SE_Pitch)            $game_temp.paused = $game_temp.paused == true ? false : true   end                def update_pausing    return if !$game_temp.paused    $game_system.save_bgm    Audio.bgm_play("Audio/BGM/" + Pause_BGM, Pause_BGM_Volume, Pause_BGM_Pitch)    loop do       if !$game_temp.paused        @pause_pic.dispose        $game_system.replay_bgm      end      break if !$game_temp.paused      update_paused      Input.update      Graphics.update              end  end                  def update_paused    update_pause_input  endendclass Scene_Battle < Scene_Base   include Game_Pause_Screen  alias pause_update_basic update_basic  def update_basic    pause_update_basic    update_pause    if $game_temp.paused      draw_pause_pic    end  end  def draw_pause_pic    @pause_pic = Sprite.new    @pause_pic.bitmap = Cache.picture(Pause_Screen::Pause_Pic)  endendclass Scene_Map < Scene_Base  include Game_Pause_Screen  alias pause_map_update update  def update    pause_map_update    update_pause    if $game_temp.paused      draw_pause_pic    end  end  def draw_pause_pic    @pause_pic = Sprite.new    @pause_pic.bitmap = Cache.picture(Pause_Screen::Pause_Pic)  endend

 

Credits

  • Z3R0X505

Note: Make sure to place the pause image in the folder.

         To turn off the music set the names of them like this ->    Pause_SE =  ""


Viewing all articles
Browse latest Browse all 416

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>