기능추가
2010.01.11 00:05

F12로 일시정지하기

조회 수 3345 추천 수 0 댓글 10
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
Extra Form
출처 Zeriab
  1. #==============================================================================
  2. # ** Pausing with F12
  3. #------------------------------------------------------------------------------
  4. # Zeriab
  5. # Version 1.1
  6. # 2009-05-25 (Year-Month-Day)
  7. #------------------------------------------------------------------------------
  8. # * Version History :
  9. #
  10. #   Version 1.0 -------------------------------------------------- (2009-05-22)
  11. #   - First release
  12. #
  13. #   Version 1.1 -------------------------------------------------- (2009-05-25)
  14. #   - The pause image now appears immediately when F12 is pressed.
  15. #   - Transitions are cut short rather than restarted when F12 is pressed.
  16. #------------------------------------------------------------------------------
  17. # * Description :
  18. #
  19. #   This script changes the functionality of pressing F12 during the game
  20. #   from resetting the game to (un)pausing the game. A picture is displayed
  21. #   while the game is paused. (Having a picture is optional)
  22. #------------------------------------------------------------------------------
  23. # * License :
  24. #
  25. #   Copyright (C) 2009  Zeriab
  26. #
  27. #   This program is free software: you can redistribute it and/or modify
  28. #   it under the terms of the GNU Lesser Public License as published by
  29. #   the Free Software Foundation, either version 3 of the License, or
  30. #   (at your option) any later version.
  31. #
  32. #   This program is distributed in the hope that it will be useful,
  33. #   but WITHOUT ANY WARRANTY; without even the implied warranty of
  34. #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  35. #   GNU Lesser Public License for more details.
  36. #
  37. #   For the full license see <http://www.gnu.org/licenses/>
  38. #   The GNU General Public License: http://www.gnu.org/licenses/gpl.txt
  39. #   The GNU Lesser General Public License: http://www.gnu.org/licenses/lgpl.txt
  40. #------------------------------------------------------------------------------
  41. # * Compatibility :
  42. #
  43. #   Is most likely not compatible with other F12 prevention scripts.
  44. #------------------------------------------------------------------------------
  45. # * Instructions :
  46. #
  47. #   Place this script anywhere above main.
  48. #   The image file 'pause' present in Graphics/Pictures is used.
  49. #   Note: No picture is shown if there is no 'pause' in Graphics/Pictures.
  50. #==============================================================================
  51.  
  52. #=============================================================================
  53. # ** Reset class (because it won't be defined until F12 is pressed otherwise)
  54. #=============================================================================
  55. class Reset < Exception
  56.  
  57. end
  58. #=============================================================================
  59. # ** Module Graphics
  60. #=============================================================================
  61. module Graphics
  62.   class << self
  63.     #-------------------------------------------------------------------------
  64.     # * Aliases Graphics.update and Graphics.transition
  65.     #-------------------------------------------------------------------------
  66.     unless self.method_defined?(:zeriab_f12_pause_update)
  67.       alias_method(:zeriab_f12_pause_update, :update)
  68.       alias_method(:zeriab_f12_pause_transition, :transition)
  69.     end
  70.     #-------------------------------------------------------------------------
  71.     # Change the update method so F12 toggles pause
  72.     #-------------------------------------------------------------------------
  73.     def update(*args)
  74.       # Try to update normally
  75.       begin
  76.         zeriab_f12_pause_update(*args)
  77.         return
  78.       rescue Reset
  79.         # Do nothing
  80.       end
  81.       # F12 has been pressed
  82.       done = false
  83.       # Store frame count
  84.       frame_count = Graphics.frame_count
  85.       # Show pause image
  86.       @sprite = Sprite.new
  87.       @sprite.z = 9999
  88.       begin
  89.         @sprite.bitmap = RPG::Cache.picture('pause')
  90.       rescue
  91.         @sprite.bitmap = Bitmap.new(32,32)
  92.       end
  93.       # Keep trying to do the update
  94.       while !done
  95.         begin
  96.           zeriab_f12_pause_update(*args)
  97.           done = true
  98.         rescue Reset
  99.           # Do Nothing
  100.         end
  101.       end
  102.       # F12 has been released, update until it is pressed again
  103.       while done
  104.         begin
  105.           zeriab_f12_pause_update(*args)
  106.         rescue Reset
  107.           done = false
  108.         end
  109.       end
  110.       # F12 has been pressed, keep trying to update
  111.       while !done
  112.         begin
  113.           zeriab_f12_pause_update(*args)
  114.           done = true
  115.         rescue Reset
  116.           # Do nothing
  117.         end
  118.       end
  119.       # F12 has been released, dispose pause image
  120.       @sprite.dispose
  121.       # Set proper frame count
  122.       Graphics.frame_count = frame_count
  123.     end
  124.     #-------------------------------------------------------------------------
  125.     # Changes the transition so it is cut short if F12 is pressed
  126.     #-------------------------------------------------------------------------
  127.     def transition(*args)
  128.       done = false
  129.       # Keep trying to do the transition
  130.       while !done
  131.         begin
  132.           zeriab_f12_pause_transition(*args)
  133.           done = true
  134.         rescue Reset
  135.           # Set transition length to 0 frames.
  136.           args[0] = 0
  137.         end
  138.       end
  139.     end
  140.   end
  141. end
  142. =====

    F12로 일시정지를 할수 있는 기능입니다

     

    사용방법 :

    예제처럼 F12버튼을 누를시, 특별한 그림을 나타내고싶을때에는

    pause그림에 사용할 그림을 graphics/pictures란에 저장합니다

    (※ 이때 저장할 그림 이름은 무조건 pause 여야 됩니다!)

    그리고 게임에 들어가서 F12 버튼을 누르면 일시정지가 되면서 그림이 뜹니다!

    예제를 첨부할테니 잘 따라해주시기 바랍니다 :)

     

    활용예제

     

  • profile
    니오티 2010.01.11 00:07

    정지 기능이 담겨있는 Sprite 그림 파일도 같이 첨부하면 좋겠구나.

  • profile
    니오티 2010.01.11 00:10

    xp만 적용되는건가?

     

  • ?
    ruby 2010.01.11 10:29

    우와우와 이런기능이면 매뉴화면을 막아놔도 퓨즈를 할수 있겠네요

  • ?
    Feather Fly 2010.01.11 15:46

    좋은 기능이네요!

  • ?
    오니짱 2010.08.01 10:44

    우와엄청좋아요!

  • ?
    오니페인! 2010.08.03 17:34

    하하하핳하!!!!!

    바로이런거야!!!!

    이거다!!!

    으흫흐흐흫흐하하핳하하하~~

    감솨합니돠~~~

  • ?
    insertend23 2010.08.10 14:06

    오!!   이런 스크립트 찾고 있었는데 ㅋㅋ

     

    좋은 스크립트 올려주셔셔 감사합니다..

  • ?
    랅뀳낈캸쿏 2010.12.18 17:10

    죄송합니다 . . . 스크립트는 어떻게 새로 만드는건가요?

  • ?
    곤지컴 2011.01.13 22:34

    잘쓸게요!!

  • ?
    앙크바르만 2011.07.09 12:55

    잘쓰겠습니다.

    감사합니다

     


List of Articles
분류 제목 글쓴이 날짜 조회 수 추천 수
공지사항 일본어 스크립트를 번역하기 좋은 번역사이트 두곳입니다 ruby 2010.01.09 22078 0
공지사항 스크립트 게시판 관리자' ruby ' 입니다 ruby 2010.01.09 20725 0
공지사항 일본 스크립트/소스 공유 포럼 4 니오티 2010.01.05 22249 0
공지사항 일본 스크립트/소스 공유 포럼 4 니오티 2010.01.05 22249 0
공지사항 일본어 스크립트를 번역하기 좋은 번역사이트 두곳입니다 ruby 2010.01.09 22078 0
공지사항 스크립트 게시판 관리자' ruby ' 입니다 ruby 2010.01.09 20725 0
기타 한글입력기 16 file 히카루 2007.01.31 14278 1
전투관련 간단한 액션알피지용 스크립트 Ver.1.01 (게임오버 추가) 38 file 펜릴 2010.04.11 8730 0
기타 Staff Roll 4 file 허걱 2010.03.04 7486 0
맵관련 맵이름 띄우기, 케릭터 ID띄우기 15 file 꼬마쟁이 2011.01.05 7388 0
온라인 RPG XP 온라인 스크립트 25 file 니오티 2007.02.15 6859 6
온라인 온라인스크립트 1.7 28 file 아디안 2007.02.16 5473 27
기타 중복일것 같은데;; [한글 이름 입력] 1 꼬마쟁이 2011.01.05 4641 0
시각적 효과 타이틀화면 나오기전 사운드아함께 로고뛰우기 예 넥슨로고 12 루비 2007.09.07 4437 6
전투관련 누구나 쉽게 만드는 액션알피지 6 펜릴 2012.11.25 4344 0
기타 게이지바 스크립트!! 최고!! 12 file 코아 코스튬 2011.08.08 4237 0
전투관련 리얼타임을 이용한 딜레이 구현 1 펜릴 2010.01.10 4197 0
메뉴관련 RPG XP 테스트플레이 할때 '뉴게임' '콘티뉴' '슛다운' 바꾸기 [중복이면 죄송] 12 이정한 2007.03.07 4153 18
기타 3d 스크립트 (적용시 바로 실행가능&암호걸림) 15 file kjs 2010.06.04 4065 0
전투관련 턴알 게이지바 변경 스크립트 (HP/SP) 3 file 니오티 2007.02.20 3984 2
시각적 효과 물가에 모습비치게 하기 25 file 아하하 2007.12.06 3947 6
전투관련 콤보 스크립트 10 아하하 2007.12.05 3699 4
XP 형식 메뉴 2 file Jenpia 2010.07.29 3639 0
Board Pagination Prev 1 2 3 4 5 6 7 Next
/ 7

Copyright ⓒ Nioting All Rights Reserved. (since 1999)    개인정보
        

Fatal error: Cannot access property sessionController::$lifetime in /web/old/xe/modules/session/session.controller.php on line 45