把Sprite_Timer的def update部分改成
def update super # 设置计时器执行中为可见 self.visible = $game_system.timer_working # 如果有必要再次描绘计时器 if $game_system.timer / Graphics.frame_rate != @total_sec # 清除窗口内容 self.bitmap.clear # 计算总计秒数 if $pause==0 @timepause=$game_system.timer $pause = 1 elsif $pause == 1 if @timepause != $game_system.timer $game_system.timer = @timepause end end @total_sec = $game_system.timer / Graphics.frame_rate # 生成计时器显示用字符串 min = @total_sec / 60 sec = @total_sec % 60 text = sprintf("%02d:%02d", min, sec) # 描绘计时器 self.bitmap.font.color.set(255, 255, 255) self.bitmap.draw_text(self.bitmap.rect, text, 1) end end
def update
super
# 设置计时器执行中为可见
self.visible = $game_system.timer_working
# 如果有必要再次描绘计时器
if $game_system.timer / Graphics.frame_rate != @total_sec
# 清除窗口内容
self.bitmap.clear
# 计算总计秒数
if $pause==0
@timepause=$game_system.timer
$pause = 1
elsif $pause == 1
if @timepause != $game_system.timer
$game_system.timer = @timepause
end
end
@total_sec = $game_system.timer / Graphics.frame_rate
# 生成计时器显示用字符串
min = @total_sec / 60
sec = @total_sec % 60
text = sprintf("%02d:%02d", min, sec)
# 描绘计时器
self.bitmap.font.color.set(255, 255, 255)
self.bitmap.draw_text(self.bitmap.rect, text, 1)
end
end
需要暂停时请
需要继续时请
|