pigu_6

CRB| Flash screen

Dec 18th, 2012
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.93 KB | None | 0 0
  1. #=============================================================================#
  2. #-----------------------------------------------------------------------------#
  3. #---------------------IBG Flash Screen/Skip Title V2.0------------------------#
  4. #=============================================================================#
  5. #--------------------------------Free to use----------------------------------#
  6. #-----------------------------No credit needed--------------------------------#
  7. #----------Special Thanks to Doctor Todd for his contribution on BGM----------#
  8. #=============================================================================#
  9. #-----------------------------------Setup-------------------------------------#
  10. #---Just place below materials and specify image to be used as flash screen.--#
  11. #-------------------(Must be in Graphics/System folder)-----------------------#
  12. #=============================================================================#
  13. class IBG_PT < Scene_Base
  14. module IBG
  15.  
  16. #=============================================================================#
  17. #------------------------------------Setup------------------------------------#
  18. #=============================================================================#
  19. # Flash: Flash image filenames. (must be in Graphics/System) #
  20. # Ex. ["Flash1",Flash2",Flash3",] #
  21. # NumF: Number of flash screens. (Be sure to add all of them to Flash) #
  22. # Delay: How long to display flash screens in frames. (60 frames = 1 Second) #
  23. # Skip: Skip title if no save exists. #
  24. # MUS: Play music with flash screens. #
  25. # FAD: Fade out music before Title Screen. #
  26. # BGM: Name of music file to play. #
  27. # Skip_Key: Key to skip flash screens, nil to disallow. #
  28. # Ex. :A, :B, or :C (Default :C) #
  29. #=============================================================================#
  30. Flash = ["Flash",]
  31. NumF = 1
  32. Delay = 120
  33. Skip = false
  34. MUS = true
  35. FAD = true
  36. BGM = "Field1"
  37. Skip_Key = :C
  38. end
  39.  
  40. #=============================================================================#
  41. #---------------------------------Processing----------------------------------#
  42. #=============================================================================#
  43.  
  44. def initialize
  45. @time = IBG::Delay
  46. @screen = 0
  47. @shown = 0
  48. end
  49.  
  50. def start
  51. super
  52. create_background
  53. if IBG::MUS
  54. Audio.bgm_play("Audio/BGM/" + IBG::BGM, 100, 100) #(DoctorTodd edit)
  55. end
  56. end
  57.  
  58. def create_background
  59. @time = IBG::Delay
  60. @sprite = Sprite.new
  61. @sprite.bitmap = Cache.system(IBG::Flash[@screen])
  62. @screen += 1
  63. @shown += 1
  64. end
  65.  
  66. def update
  67. super
  68. if Input.press?(IBG::Skip_Key)
  69. goto_title
  70. end
  71. if @shown == IBG::NumF and @time == 0
  72. goto_title
  73. else
  74. if @time == 0 and @shown <= IBG::NumF
  75. create_background
  76. else
  77. @time -= 1
  78. end
  79. end
  80. end
  81.  
  82. def dispose_background
  83. @sprite.bitmap.dispose
  84. @sprite.dispose
  85. end
  86.  
  87. def goto_title
  88. if IBG::Skip
  89. if DataManager.save_file_exists?
  90. if IBG::FAD
  91. fadeout_all
  92. end
  93. SceneManager.goto(Scene_Title)
  94. else
  95. DataManager.setup_new_game
  96. if IBG::FAD
  97. fadeout_all
  98. end
  99. $game_map.autoplay
  100. SceneManager.goto(Scene_Map)
  101. end
  102. else
  103. DataManager.save_file_exists?
  104. if IBG::FAD
  105. fadeout_all
  106. end
  107. SceneManager.goto(Scene_Title)
  108. end
  109. end
  110. end
  111.  
  112. module SceneManager
  113.  
  114. def self.first_scene_class
  115. $BTEST ? Scene_Battle : IBG_PT
  116. end
  117. end
Advertisement
Add Comment
Please, Sign In to add comment