Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # ++ Custom Title Screen [VX] ver. 1.00 ++
- # Script by paradog
- # http://2d6.parasite.jp/
- #------------------------------------------------------------------------------
- # Use images in the title menu, or change the appearance of the menu window.
- #==============================================================================
- module PARA_TITLE_CUSTOM
- # images for menu commands ( true / false )
- IMG_MENU = true
- #↓---Setting for using images in menu commands---
- # Image file name used for menu command (imported from "Graphics / System")
- #(When command is not selected, the format reset itself)
- # New Game
- IMG_NEWGAME = ["newgame","newgame_active"]
- IMG_NEWGAME_X = 200 # X coordinate
- IMG_NEWGAME_Y = 300 # Y coordinate
- # Continue
- IMG_CONTINUE = ["continue","continue_active"]
- IMG_CONTINUE_X = 200 # X coordinate
- IMG_CONTINUE_Y = 332 # Y coordinate
- # Shutdown
- IMG_SHUTDOWN = ["shutdown","shutdown_active"]
- IMG_SHUTDOWN_X = 200 # X coordinate
- IMG_SHUTDOWN_Y = 364 # Y coordinate
- # Continue disabled (0: translucent / 1: designates image)
- LOAD_DISABLED_TYPE = 0
- # Image when Continue is disabled
- IMG_CONTINUE_DISABLED = ["continue_disabled","continue_disabled_active"]
- # Image blend type ( 0:default / 1:add / 2:subtract )
- BLEND_TYPE = 0
- #↓---Setting if menu isn't using an image---
- # Hide window pane (true / false)
- WINDOW_TRANS = false
- # Window transparency (specified when window pane is displayed)
- WINDOW_OPACITY = 160
- # Horizontal window width
- WINDOW_WIDTH = 172
- # Horizontal window position ( 0:default / 1:left / 2:center / 3:right )
- WINDOW_ALIGN = 2
- # Window X coordinate
- WINDOW_POS_X = 0
- # Vertical window position ( 0:default / 1:upper / 2:center / 3:lower )
- WINDOW_VALIGN = 0
- # Window Y coordinate
- WINDOW_POS_Y = 288
- end
- # ↑ Setting are here
- #------------------------------------------------------------------------------
- #==============================================================================
- # ■ Scene_Title
- #==============================================================================
- class Scene_Title < Scene_Base
- #--------------------------------------------------------------------------
- # ● Create command window
- #--------------------------------------------------------------------------
- def create_command_window
- s1 = Vocab::new_game
- s2 = Vocab::continue
- s3 = Vocab::shutdown
- w = PARA_TITLE_CUSTOM::WINDOW_WIDTH
- @command_window = Window_Command.new(w, [s1, s2, s3])
- @command_window.x = (544 - @command_window.width) / 2
- @command_window.y = 288
- if @continue_enabled # if continue enabled
- @command_window.index = 1 # cursor movement
- else # invalid case
- @command_window.draw_item(1, false) # set command window translucent
- end
- @command_window.openness = 0
- # command window image usage
- if PARA_TITLE_CUSTOM::IMG_MENU
- # hide command window
- @command_window.opacity = 0
- @command_window.contents_opacity = 0
- create_img_command_window
- else
- change_window_visual
- end
- @command_window.open
- end
- #--------------------------------------------------------------------------
- # ○ Command window visual setting
- #--------------------------------------------------------------------------
- def change_window_visual
- # Window transparency
- if PARA_TITLE_CUSTOM::WINDOW_TRANS
- @command_window.opacity = 0
- else
- @command_window.back_opacity = PARA_TITLE_CUSTOM::WINDOW_OPACITY
- end
- # Command window position
- case PARA_TITLE_CUSTOM::WINDOW_ALIGN
- when 0
- @command_window.x = PARA_TITLE_CUSTOM::WINDOW_POS_X
- when 1
- @command_window.x = 0
- when 2
- @command_window.x = ( 544 - @command_window.width ) / 2
- when 3
- @command_window.x = 544 - @command_window.width
- end
- case PARA_TITLE_CUSTOM::WINDOW_VALIGN
- when 0
- @command_window.y = PARA_TITLE_CUSTOM::WINDOW_POS_Y
- when 1
- @command_window.y = 0
- when 2
- @command_window.y = ( 416 - @command_window.height ) / 2
- when 3
- @command_window.y = 416 - @command_window.height
- end
- end
- #--------------------------------------------------------------------------
- # ○ Create image command window
- #--------------------------------------------------------------------------
- def create_img_command_window
- # Create sprite
- sprite1 = Sprite.new
- sprite1.x = PARA_TITLE_CUSTOM::IMG_NEWGAME_X
- sprite1.y = PARA_TITLE_CUSTOM::IMG_NEWGAME_Y
- sprite1.blend_type = PARA_TITLE_CUSTOM::BLEND_TYPE
- sprite2 = Sprite.new
- sprite2.x = PARA_TITLE_CUSTOM::IMG_CONTINUE_X
- sprite2.y = PARA_TITLE_CUSTOM::IMG_CONTINUE_Y
- sprite2.blend_type = PARA_TITLE_CUSTOM::BLEND_TYPE
- sprite3 = Sprite.new
- sprite3.x = PARA_TITLE_CUSTOM::IMG_SHUTDOWN_X
- sprite3.y = PARA_TITLE_CUSTOM::IMG_SHUTDOWN_Y
- sprite3.blend_type = PARA_TITLE_CUSTOM::BLEND_TYPE
- # Manage by spriteset
- @command_sprites = [sprite1, sprite2, sprite3]
- # Manage bitmap filenames as array
- @command_bitmaps = [PARA_TITLE_CUSTOM::IMG_NEWGAME, PARA_TITLE_CUSTOM::IMG_CONTINUE, PARA_TITLE_CUSTOM::IMG_SHUTDOWN]
- if @continue_enabled # When continue enabled
- select_img_item(1) # Cursor movement
- else # Invalid case
- case PARA_TITLE_CUSTOM::LOAD_DISABLED_TYPE
- when 0 # semi-transparent image
- @command_sprites[1].opacity = 160
- when 1 # disabled image only
- @command_bitmaps[1] = PARA_TITLE_CUSTOM::IMG_CONTINUE_DISABLED
- end
- select_img_item(0) # Cursor movement
- end
- end
- #--------------------------------------------------------------------------
- # ● Update
- #--------------------------------------------------------------------------
- def update
- super
- @command_window.update
- if PARA_TITLE_CUSTOM::IMG_MENU
- if Input.repeat?(Input::UP) or Input.repeat?(Input::DOWN)
- # select image
- select_img_item(@command_window.index)
- end
- end
- if Input.trigger?(Input::C)
- case @command_window.index
- when 0 # new game
- command_new_game
- when 1 # continue
- command_continue
- when 2 # shutdown
- command_shutdown
- end
- end
- end
- #--------------------------------------------------------------------------
- # ○ Image set during menu selection
- #--------------------------------------------------------------------------
- def select_img_item(index)
- case index
- when 0
- @command_sprites[0].bitmap = Cache.system(@command_bitmaps[0][1])
- @command_sprites[1].bitmap = Cache.system(@command_bitmaps[1][0])
- @command_sprites[2].bitmap = Cache.system(@command_bitmaps[2][0])
- when 1
- @command_sprites[0].bitmap = Cache.system(@command_bitmaps[0][0])
- @command_sprites[1].bitmap = Cache.system(@command_bitmaps[1][1])
- @command_sprites[2].bitmap = Cache.system(@command_bitmaps[2][0])
- when 2
- @command_sprites[0].bitmap = Cache.system(@command_bitmaps[0][0])
- @command_sprites[1].bitmap = Cache.system(@command_bitmaps[1][0])
- @command_sprites[2].bitmap = Cache.system(@command_bitmaps[2][1])
- end
- end
- #--------------------------------------------------------------------------
- # ● Dispose command window
- #--------------------------------------------------------------------------
- def dispose_command_window
- @command_window.dispose
- if @command_sprites != nil
- @command_sprites[0].dispose
- @command_sprites[1].dispose
- @command_sprites[2].dispose
- end
- end
- #--------------------------------------------------------------------------
- # ● Open command window
- #--------------------------------------------------------------------------
- def open_command_window
- # Display when window background is hidden
- if PARA_TITLE_CUSTOM::WINDOW_TRANS
- @command_window.openness = 255
- end
- @command_window.open
- begin
- @command_window.update
- Graphics.update
- end until @command_window.openness == 255
- end
- #--------------------------------------------------------------------------
- # ● Close command window
- #--------------------------------------------------------------------------
- def close_command_window
- # Don't close when window background is hidden
- if not(PARA_TITLE_CUSTOM::WINDOW_TRANS)
- @command_window.close
- begin
- @command_window.update
- Graphics.update
- end until @command_window.openness == 0
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement