Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #=========================================================#
- # Rafidelis KáHh Box Title #
- # Por: Rafidelis #
- # Data: 03/01/09 #
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
- # Creditos : KahH por fazer a versão por Eventos para o #
- # Rpg Maker XP. Vlw KahH,bjs pra vc^^ #
- #=========================================================#
- #=========================================================#
- # Instruções: #
- #---------------------------------------------------------#
- # Colar acima do main,e editar o modulo Rafidelis. #
- # As imagens que servirão como opções no title,devem ter #
- # tamanho de 81 x 380 px para não ocasionar em erros. #
- #=========~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=============#
- #=============================================
- # INICIO DAS CONFIGURAÇÕES
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- module Rafidelis
- PIC_NAMES =
- [
- "I1", # Nome da Imagem de novo jogo
- "I2", # Nome da Imagem de load game
- "I3", # Nome da Imagem de Extra
- "I4", # Nome da Imagem de Options
- "I5", # Nome da Imagem de Exit (Sair)
- "I6", # Nome da Imagem de Creditos
- "BG", # Nome da Imagem de fundo
- "Credits" # Nome da Imagem da Imagem de Creditos
- ]
- BOX_PIC_FINAL_OPACITY = 200 # Opacidade Final das imagens de Opções
- BG_FINAL_OPACITY = 200 # Opacidade Final da imagem de background
- #=============================================
- # FIM DAS CONFIGURAÇÕES
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- end
- class Scene_Title < Scene_Base
- include Rafidelis
- alias rafidelis_kaHh_box_title_start start
- def start
- rafidelis_kaHh_box_title_start
- #==========================#
- # Declarando os Sprites #
- #==========================#
- @newgame = Sprite.new
- @continue = Sprite.new
- @credits = Sprite.new
- @exit = Sprite.new
- @background = Sprite.new
- #==========================#
- # Criando as Imagens #
- #==========================#
- @newgame.bitmap = Cache.picture(PIC_NAMES[0])
- @continue.bitmap = Cache.picture(PIC_NAMES[1])
- @exit.bitmap = Cache.picture(PIC_NAMES[4])
- @credits.bitmap = Cache.picture(PIC_NAMES[5])
- @background.bitmap = Cache.picture(PIC_NAMES[6])
- @background.z = @sprite.z + 3
- @newgame.z = @background.z + 3
- @continue.z = @newgame.z
- @credits.z = @newgame.z
- @exit.z = @newgame.z
- @sprite.visible = false
- #============================================#
- # Definindo as Coordenadas X e Y das Imagens #
- #============================================#
- @newgame.x = 70
- @continue.x = @newgame.x + @continue.width + 25
- @credits.x = @continue.x + @credits.width + 25
- @exit.x = @credits.x + @exit.width + 25
- @newgame.y = (Graphics.height - @newgame.height)/2
- @continue.y = @newgame.y
- @credits.y = @newgame.y
- @exit.y = @newgame.y
- #=====================================#
- # Definindo a opacidade das Imagens #
- #=====================================#
- @newgame.opacity = 0
- @continue.opacity = 0
- @exit.opacity = 0
- @credits.opacity = 0
- @background.opacity = 80
- #======================================#
- # bla bla bla bla bla bla bla bla bla #
- #======================================#
- @efetuar_fadein = true # Efetuar Fade in Inicial
- @command_window.opacity = 0 # Janela de comando com Opacidade 0
- @command_window.contents_opacity = 0 # Deixando o conteudo da Janela de Comando em 0
- @command_window.active = false # Agora a janela de Comandos é inativa
- @img = Sprite.new
- @img.bitmap = Cache.picture(PIC_NAMES[7])
- @img.visible = false # A imagem ainda não é visivel
- @img.z = @newgame.z + 100
- end
- #=====================================#
- # Criando a Janela de Comandos #
- #=====================================#
- def create_command_window
- s1 = Vocab::new_game
- s2 = Vocab::continue
- s3 = Vocab::shutdown
- s4 = "" # Criando 6 opções na janela de comando
- @command_window = Window_Command.new(544, [s1, s2, s3,s4],4)
- if @continue_enabled # Se houver arquivos salvos
- @command_window.index = 1 # Opção habilitada
- else # Se não houver arquivos salvos
- @command_window.draw_item(1, false) # Opção desabilitada
- end
- @command_window.openness = 0
- @command_window.open
- end
- #==============#
- # Atualizando #
- #==============#
- def update
- @command_window.update
- @img.opacity += 1 if @img.opacity < 255
- @background.opacity += 1 if @background.opacity < BG_FINAL_OPACITY and @efetuar_fadein == true
- @newgame.opacity += 1 if @newgame.opacity < 255 and @background.opacity > 100 and @efetuar_fadein == true
- @continue.opacity += 1 if @newgame.opacity >= 55 and @continue.opacity < BOX_PIC_FINAL_OPACITY and @efetuar_fadein == true
- @credits.opacity += 1 if @continue.opacity >= 55 and @credits.opacity < BOX_PIC_FINAL_OPACITY and @efetuar_fadein == true
- @exit.opacity += 1 if @credits.opacity >= 55 and @exit.opacity < BOX_PIC_FINAL_OPACITY and @efetuar_fadein == true
- if Input.trigger?(Input::B) and @img.visible == true # Se estiver na tela de creditos e apertar ESC
- @img.visible = false
- @command_window.visible = true
- end
- if @exit.opacity >= BOX_PIC_FINAL_OPACITY
- @command_window.active = true
- @efetuar_fadein = false
- end
- if @command_window.index == 0 and @efetuar_fadein == false
- @newgame.opacity = 255
- @continue.opacity = BOX_PIC_FINAL_OPACITY
- @credits.opacity = BOX_PIC_FINAL_OPACITY
- @exit.opacity = BOX_PIC_FINAL_OPACITY
- @index = 0
- elsif @command_window.index == 1
- @continue.opacity = 255
- @newgame.opacity = BOX_PIC_FINAL_OPACITY
- @credits.opacity = BOX_PIC_FINAL_OPACITY
- @exit.opacity = BOX_PIC_FINAL_OPACITY
- @index = 1
- elsif @command_window.index == 2
- @continue.opacity = BOX_PIC_FINAL_OPACITY
- @newgame.opacity = BOX_PIC_FINAL_OPACITY
- @credits.opacity = 255
- @exit.opacity = BOX_PIC_FINAL_OPACITY
- @index = 2
- elsif @command_window.index == 3
- @continue.opacity = BOX_PIC_FINAL_OPACITY
- @newgame.opacity = BOX_PIC_FINAL_OPACITY
- @credits.opacity = BOX_PIC_FINAL_OPACITY
- @exit.opacity = 255
- @index = 3
- end
- if Input.trigger?(Input::C)
- case @index
- when 0
- command_new_game
- when 1
- command_continue
- when 2
- Sound.play_decision
- @command_window.active = false
- @command_window.visible = false
- @img.visible = true
- @img.opacity = 0
- when 3
- command_shutdown
- end
- end
- end
- #=======================================================#
- # Terminando e efetuando a disposição das Imagens #
- #=======================================================#
- alias rafidelis_kaHh_box_menu_terminate terminate
- def terminate
- rafidelis_kaHh_box_menu_terminate
- @newgame.dispose
- @continue.dispose
- @credits.dispose
- @exit.dispose
- @background.dispose
- end
- end
- #================================================================================
- # FIM DO SCRIPT - Encontre mais Scripts de Rafidelis em www.ReinoRpg.com/forum
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Advertisement
Add Comment
Please, Sign In to add comment