RPGXP Script
2013.09.29 03:45

일시정지 스크립트

Views 1154 Votes 0 Comment 2
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

일시정지 스크립트 적용 방법 **

pause 라는 파일을 픽쳐에 넣어주세요.

이름이 꼭 pause 이여야 함.

pause 파일은 만들어서 넣어주세요.

 

 

#==============================================================================
# ** Pausing with F12
#------------------------------------------------------------------------------
# Zeriab
# Version 1.1
# 2009-05-25 (Year-Month-Day)
#------------------------------------------------------------------------------
# * Version History :
#
#   Version 1.0 -------------------------------------------------- (2009-05-22)
#   - First release
#
#   Version 1.1 -------------------------------------------------- (2009-05-25)
#   - The pause image now appears immediately when F12 is pressed.
#   - Transitions are cut short rather than restarted when F12 is pressed.
#------------------------------------------------------------------------------
# * Description :
#
#   This script changes the functionality of pressing F12 during the game
#   from resetting the game to (un)pausing the game. A picture is displayed 
#   while the game is paused. (Having a picture is optional)
#------------------------------------------------------------------------------
# * License :
#
#   Copyright (C) 2009  Zeriab
#
#   This program is free software: you can redistribute it and/or modify
#   it under the terms of the GNU Lesser Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU Lesser Public License for more details.
#
#   For the full license see <http://www.gnu.org/licenses/
#   The GNU General Public License: http://www.gnu.org/licenses/gpl.txt
#   The GNU Lesser General Public License: http://www.gnu.org/licenses/lgpl.txt
#------------------------------------------------------------------------------
# * Compatibility :
#
#   Is most likely not compatible with other F12 prevention scripts.
#------------------------------------------------------------------------------
# * Instructions :
#
#   Place this script anywhere above main.
#   The image file 'pause' present in Graphics/Pictures is used.
#   Note: No picture is shown if there is no 'pause' in Graphics/Pictures.
#==============================================================================
 
#=============================================================================
# ** Reset class (because it won't be defined until F12 is pressed otherwise)
#=============================================================================
class Reset < Exception
  
end
#=============================================================================
# ** Module Graphics
#=============================================================================
module Graphics
  class << self
    #-------------------------------------------------------------------------
    # * Aliases Graphics.update and Graphics.transition
    #-------------------------------------------------------------------------
    unless self.method_defined?(:zeriab_f12_pause_update)
      alias_method(:zeriab_f12_pause_update, :update)
      alias_method(:zeriab_f12_pause_transition, :transition)
    end
    #-------------------------------------------------------------------------
    # Change the update method so F12 toggles pause
    #-------------------------------------------------------------------------
    def update(*args)
      # Try to update normally
      begin
        zeriab_f12_pause_update(*args)
        return
      rescue Reset
        # Do nothing
      end
      # F12 has been pressed
      done = false
      # Store frame count
      frame_count = Graphics.frame_count
      # Show pause image
      @sprite = Sprite.new
      @sprite.z = 9999
      begin
        @sprite.bitmap = RPG::Cache.picture('pause')
      rescue
        @sprite.bitmap = Bitmap.new(32,32)
      end
      # Keep trying to do the update
      while !done
        begin
          zeriab_f12_pause_update(*args)
          done = true
        rescue Reset
          # Do Nothing
        end
      end
      # F12 has been released, update until it is pressed again
      while done
        begin
          zeriab_f12_pause_update(*args)
        rescue Reset
          done = false
        end
      end
      # F12 has been pressed, keep trying to update
      while !done
        begin
          zeriab_f12_pause_update(*args)
          done = true
        rescue Reset
          # Do nothing
        end
      end
      # F12 has been released, dispose pause image
      @sprite.dispose
      # Set proper frame count
      Graphics.frame_count = frame_count
    end
    #-------------------------------------------------------------------------
    # Changes the transition so it is cut short if F12 is pressed
    #-------------------------------------------------------------------------
    def transition(*args)
      done = false
      # Keep trying to do the transition
      while !done
        begin
          zeriab_f12_pause_transition(*args)
          done = true
        rescue Reset
          # Set transition length to 0 frames.
          args[0] = 0
        end
      end
    end
  end
end

?

List of Articles
No. Category Subject Author Date Views Votes
288 RPGXP Script 새로운 게임 시작/로드 시 미묘한 연출 추가. 창조도시 2007.12.01 2539 1
287 RPGXP Script 대화 글씨 폰트를 원하는 폰트로 바꾸기 창조도시 2007.12.01 1664 2
286 RPGXP Script 대각선 방향 이동추가로 8방향 이동 만들기. 1 창조도시 2008.08.14 2448 1
285 RPGXP Script 맵 이름을 화면 상단에 띄우기. 1 1 file 창조도시 2008.10.12 2399 1
284 RPGXP Script 최초 시작화면에 제작자 정보를 띄워보자. 6 창조도시 2008.04.04 2198 5
283 RPGXP Script 선택 메뉴를 가운데 정렬 해보자. 1 file 창조도시 2007.12.02 1657 2
282 RPGXP Script 아이템창을 아이템 분류별로 나누어 지게 개조. 3 file 창조도시 2007.12.02 1867 1
281 RPGXP Script c[n] 명령어 줄때의 색상 결정. 창조도시 2008.02.14 1329 1
280 RPGXP Script 대화창에 얼굴 띄우기& 대화창 명령어 모음. 1 file 창조도시 2008.12.31 2350 1
279 RPGXP Script 게임도중에 글씨체를 바꿔보자. 창조도시 2008.12.31 1529 1
278 RPGXP Script 대화창에 이름&얼굴 띄우기 새로운방식. file 창조도시 2007.11.06 3878 3
277 RPGXP Script 그림자문자 사용하기.. 바탕색이 무슨색이건 상관없이 글자가 잘보인다!!! 창조도시 2007.11.06 1696 1
276 RPGXP Script 기차 파티 스크립트 2 창조도시 2008.07.24 1701 2
275 RPGXP Script 한글이름입력기 v1.76 1 1 창조도시 2008.07.24 2923 2
274 RPGXP Script 창고 시스템 2 창조도시 2008.01.18 2005 3
273 RPGXP Script 물가에가면 캐릭터를 반사시켜주는 스크립트 4 file 창조도시 2007.12.02 4776 6
272 RPGXP Script 파티 선두 캐릭터 id 변수에 넣기 Evangelista 2008.01.08 1655 1
271 RPGVX Script vx 한글이름입력 2 file 가가상 2010.05.21 3335 1
270 RPGVX Script [VX] 파티 선두 캐릭터 액터ID를 변수에 넣기 Evangelista 2008.11.28 1950 1
269 RPGVX Script [VX] 조건분기로 키입력의 처리 실행 1 Evangelista 2008.11.28 1987 1
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 15 Next
/ 15


[privacy statements] | [Terms of Use] | [Contact us] | [Sponsorship] | [Indiside History]

Copyright © 1999 - 2016 INdiSide.com/CL3D Co., Ltd. All Rights Reserved.
Owner : Chunmu(Jiseon Lee) | kernys(Wonbae Kim) | Sasinji(Byungkook Kim)