加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 牲口 于 2013-3-14 22:12 编辑
############################################################################### #Pause Script Version 3 # Author: Unsigned_Zero # Updated by Tsukihime ############################################################################### # Pause picture should be placed in the Graphics/System folder module U0_Pause_module PAUSE_BUTTON = "B" Pause_Picture = "Pause" #dim the screen during pause Dim_Screen = false Dim_Brightness = 100 #The bgm to play when paused Pause_Music = "1" #The bgm volume when paused Pause_Volume = 0 # Freeze Time when in pause mode? TIME_STOP = true PAUSE_BUTTON2 = eval("Input::#{PAUSE_BUTTON}") PAUSE_OPACITY = 255 #opacity of the picture def stopping bgm = RPG::BGM.last bgs = RPG::BGS.last prev_brightness = Graphics.brightness RPG::BGM.stop Audio.bgm_play('Audio/BGM/' + Pause_Music, Pause_Volume) viewport1 = Viewport.new(0, 0, Graphics.width, Graphics.height) viewport1.z = 10000 pause_sprite = Sprite.new(viewport1) pause_sprite.tone = Tone.new(0, 0, 0, 0) pause_sprite.bitmap = Cache.system (Pause_Picture) pause_sprite.opacity = PAUSE_OPACITY loop do Graphics.update Graphics.brightness = Dim_Brightness if Dim_Screen Input.update if Input.trigger?(PAUSE_BUTTON2) break end end Graphics.brightness = prev_brightness bgm.play(bgm.pos) bgs.play(bgs.pos) pause_sprite.dispose pause_sprite = nil end end #============================================================================== # Scene_Base #============================================================================== class Scene_Base include U0_Pause_module alias u0_pause_update update def update if Input.trigger?(PAUSE_BUTTON2) frame = Graphics.frame_count stopping if TIME_STOP Graphics.frame_count = frame end end u0_pause_update end end
###############################################################################
#Pause Script Version 3
# Author: Unsigned_Zero
# Updated by Tsukihime
###############################################################################
# Pause picture should be placed in the Graphics/System folder
module U0_Pause_module
PAUSE_BUTTON = "B"
Pause_Picture = "Pause"
#dim the screen during pause
Dim_Screen = false
Dim_Brightness = 100
#The bgm to play when paused
Pause_Music = "1"
#The bgm volume when paused
Pause_Volume = 0
# Freeze Time when in pause mode?
TIME_STOP = true
PAUSE_BUTTON2 = eval("Input::#{PAUSE_BUTTON}")
PAUSE_OPACITY = 255 #opacity of the picture
def stopping
bgm = RPG::BGM.last
bgs = RPG::BGS.last
prev_brightness = Graphics.brightness
RPG::BGM.stop
Audio.bgm_play('Audio/BGM/' + Pause_Music, Pause_Volume)
viewport1 = Viewport.new(0, 0, Graphics.width, Graphics.height)
viewport1.z = 10000
pause_sprite = Sprite.new(viewport1)
pause_sprite.tone = Tone.new(0, 0, 0, 0)
pause_sprite.bitmap = Cache.system (Pause_Picture)
pause_sprite.opacity = PAUSE_OPACITY
loop do
Graphics.update
Graphics.brightness = Dim_Brightness if Dim_Screen
Input.update
if Input.trigger?(PAUSE_BUTTON2)
break
end
end
Graphics.brightness = prev_brightness
bgm.play(bgm.pos)
bgs.play(bgs.pos)
pause_sprite.dispose
pause_sprite = nil
end
end
#==============================================================================
# Scene_Base
#==============================================================================
class Scene_Base
include U0_Pause_module
alias u0_pause_update update
def update
if Input.trigger?(PAUSE_BUTTON2)
frame = Graphics.frame_count
stopping
if TIME_STOP
Graphics.frame_count = frame
end
end
u0_pause_update
end
end
自己搞了半天 没成功 只好求助了
这个脚本用来暂停游戏的 但是我并不希望随时能暂停
求各位大大帮忙加个开关 让开关开启时这个脚本才有效 |