标题: 如何让vx实现va的loading效果? [打印本页] 作者: 2669785948 时间: 2015-2-14 17:02 标题: 如何让vx实现va的loading效果? 各位大神请教一下,怎么样让vx和子弹君的宠物王国那样,存档和读取时loading一下?作者: 2669785948 时间: 2015-2-14 17:30
这边还有va的脚本
#===============================================================================
# +++ MOG - Advanced Load Bar (v1.1) +++
#===============================================================================
# By Moghunter
# http://www.atelier-rgss.com
#===============================================================================
# Apresenta uma barra de carregar entre as cenas de Save e Load.
#
# O propósito deste Script é apresentar alguns artworks de seu jogo
# enquanto o jogador espera a barra de leitura.
#
#===============================================================================
# Você pode adpatar esse script em alguma outra Scene ou ativar pelo evento.
# Basta usar este código.
#
# SceneManager.call(Scene_Load_Bar)
#
#==============================================================================
# ● Histórico (Version History)
#==============================================================================
# v 1.1 - Melhoria no sistema de dispose de imagens.
#==============================================================================
module MOG_LOAD_BAR
# Tempo para fazer load.(Segundos)
LOAD_DURATION = 3
# Ativar o sistema ao carregar o jogo.
ENABLE_LOAD_BAR_FOR_SCENE_LOAD = true
# Ativar o sistema ao salvar o jogo.
ENABLE_LOAD_BAR_FOR_SCENE_SAVE = true
# Definição das imagens que ficarão no plano de fundo.
LOAD_BACKGROUND_PICTURES = [
"Background_1",
"Background_2",
"Background_3",
"Background_4",
#"Background_5",
#"Background_6"
#"Background_7",
#"Background_8",
#"Background_9",
#"Background_10",
# ...
]
# Ativar ordem aleatória ou sequencial.
PICTURE_RANDOM_SELECTION = true
# Posição do geral da Hud.
LOAD_BAR_POSITION = [30,350]
# Posição do medidor.
LOAD_BAR_METER_POSITION = [11,27]
# Posição do Texto.
LOAD_BAR_TEXT_POSITION = [ 10, -3]
# Som ao carregar o arquivo.
LOAD_SE = "Decision2"
# Velocidade da animação do medidor.
LOAD_BAR_FLOW_SPEED = 25
# Definição da Cena que será ativada após salvar via menu.
# Caso o save seja feito pelo evento, a cena será o Mapa.
RETURN_TO_SCENE = Scene_Menu.new(4)
# Ativar a animação de levitação do texto.
ENABLE_FLOAT_TEXT_ANIMATION = true
# Apresentar o sprite do personagem.
ENABLE_CHARACTER_SPRITE = true
# Ativar barras laterais.
ENABLE_STRIPE_SPRITE = true
# Velocidade das barras laterais.
STRIPE_SPEED = 1
end
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
alias load_bar_initialize initialize
def initialize
@load_bar_pre_index = -1
@loadbar_type = 0
load_bar_initialize
end
end
#=============================================================================
# ■ Game_System
#=============================================================================
class Game_System
attr_accessor :load_bar_pre_index
#--------------------------------------------------------------------------
# ● Initialize
#--------------------------------------------------------------------------
alias load_bar_initialize initialize
def initialize
load_bar_initialize
@load_bar_pre_index = 0
end
#--------------------------------------------------------------------------
# ● BGS Stop
#--------------------------------------------------------------------------
def bgs_stop
Audio.bgs_stop
end
end
#=============================================================================
# ■ Scene Load Bar
#=============================================================================
class Scene_Load_Bar
include MOG_LOAD_BAR
#--------------------------------------------------------------------------
# ● Main
#--------------------------------------------------------------------------
def main
Graphics.transition
execute_loop
execute_dispose
end
#--------------------------------------------------------------------------
# ● Execute Loop
#--------------------------------------------------------------------------
def execute_loop
loop do
update
Graphics.update
if SceneManager.scene != self
break
end
end
end
#--------------------------------------------------------------------------
# ● update_float_text
#--------------------------------------------------------------------------
def update_float_text
return unless ENABLE_FLOAT_TEXT_ANIMATION
@text_float_time += 1
case @text_float_time
when 1..10
@text_float_y += 1
when 11..20
@text_float_y -= 1
else
@text_float_y = 0
@text_float_time = 0
end
@text_sprite.y = @text_fy + @text_float_y
end
#--------------------------------------------------------------------------
# ● Update Bar Flow
#--------------------------------------------------------------------------
def update_bar_flow
@bar_sprite.bitmap.clear
@bar_width = @bar_range * @load_duration / @load_duration_max
@bar_width = @bar_range if @load_duration > @load_duration_max
@bar_src_rect = Rect.new(@bar_flow, 0,@bar_width, @bar_height)
@bar_bitmap.blt(0,0, @bar_image, @bar_src_rect)
@bar_flow += LOAD_BAR_FLOW_SPEED
if @bar_flow >= @bar_image.width - @bar_range
@bar_flow = 0
end
end
#--------------------------------------------------------------------------
# ● Update Bar Duration
#--------------------------------------------------------------------------
def update_bar_duration
@load_duration += 1
if @load_duration == @load_duration_max
Audio.se_play("Audio/SE/" + LOAD_SE,100,100) rescue nil
elsif @load_duration == @load_duration_max + 10
if @bar_type == 0
SceneManager.return
$game_system.replay_bgm
else
SceneManager.return
end
$game_temp.loadbar_type = false
end
end
end
#=============================================================================
# ■ Scene Save
#=============================================================================
class Scene_Save < Scene_File
#--------------------------------------------------------------------------
# ● On Save Sucess
#--------------------------------------------------------------------------
alias mog_advloadbar_on_save_success on_save_success
def on_save_success
mog_advloadbar_on_save_success
$game_temp.loadbar_type = 1
SceneManager.call(Scene_Load_Bar)
end
end
#=============================================================================
# ■ Scene Load
#=============================================================================
class Scene_Load < Scene_File
#--------------------------------------------------------------------------
# ● On Load Success
#--------------------------------------------------------------------------
alias mog_advloadbar_on_load_success on_load_success
def on_load_success
mog_advloadbar_on_load_success
$game_system.save_bgm
RPG::BGM.stop
$game_temp.loadbar_type = 0
SceneManager.call(Scene_Load_Bar)
end
end