Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # ■ Titlescreen Luna
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # Basic title screen who permit to have some luna cuztomisation
- # Ceated by Nio Kasgami.
- # Data : 2015/01/12
- # Version : 0.2 (Alpha)
- #==============================================================================
- module Nio_luna
- module Title_screen
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- SYSTEM ={
- #set the time you this will take for fadein the screen.
- :transition_time => 100,
- #set to true if you want to use the Lunatic Background script.
- :lunatic_background => false
- } #end SYSTEM
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- SPLASH_SCREEN ={
- #set to true for create a splash screen before the titlescreen.
- :splash_screen_enable => true,
- #~ #set the time your splash screen will play.
- #~ :splash_screen_duration => 20,
- #~ #the name of your logos filename.
- #~ :logo_bitmap => "",
- #~ # Logo background filename.
- #~ :logo_layers_bitmap => "Layer_",
- #~ # Permit to create layer in your background with mutliple effect.
- #~ # "number" => [ "A","B","C"]
- #~ # A = value z axis.
- #~ # B = value speed movement x.
- #~ # C = value speed movement y.
- #~ :logo_backgrounds_layers => {
- #~ 1 =>[0,1,2]
- #~ },
- #~ #permit to have a ME who play while the splash screen is on.
- #~ :logo_me => "Inn",
- #~ # this here you settle some special lunatic command.
- #~ # E.g : animated character.
- #~ :lunatic => {
- #~ }
- } #end SPLASH_SCREEN
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- BACKGROUND ={
- #position x of the first background
- :back_x => Graphics.width / 2,
- #position y of the first background
- :back_y => Graphics.height / 2,
- #position x of the second background
- :back2_x => Graphics.width / 2,
- #position y of the second background
- :back2_y => Graphics.height / 2
- } #end BACKGROUND
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- TITLE ={
- # the filename of the title graphics
- # left it empty if you want to use a font for the title.
- :bitmap => "",
- # the x coordinate position in the screen.
- # set to 0 for center to the screen (text only)
- :x => 0,
- # the y coordinate position in the screen.
- # set to 0 for center to the screen (text only)
- :y => 0,
- # the z axis more high the value and more is the priority.
- :z => 100,
- #Title font setting (only if :bitmap == "" )
- :font => ["Arial","" ],
- #Title font size
- :size => 40,
- #set the font on bold
- :bold => true,
- #set the font on italic
- :italic => false,
- #set the font on outline
- :outline => false
- }
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- COMMANDS ={
- # the type of command you want
- #"default" = the default command
- #"hori" = horizontal style command
- #"clockwise" = a circular style of command
- #please notice the clockwise command don't work with the default window
- :command_type => "", # not enable for the moment
- #set the position x of the window
- :x => 100,
- #set the position y of the window
- :y => 230,
- #set the opacity of the window
- :opacity => 0
- }
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- end # Title_Screen
- end # Nio_Luna
- ###############################################################################
- # END OF CUSTOMIZATION!
- ###############################################################################
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # Scene_Title
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- class Scene_Title < Scene_Base
- include Nio_luna::Title_screen
- #--------------------------------------------------------------------------
- # ● overwrite method: start
- #--------------------------------------------------------------------------
- def start
- super
- SceneManager.clear
- Graphics.freeze
- execute_base
- execute_splash_screen if SPLASH_SCREEN[:splash_screen_enable]
- create_graphics
- play_title_music
- end
- #--------------------------------------------------------------------------
- # ● overwrite method: transition_speed
- #--------------------------------------------------------------------------
- def transition_speed
- return SYSTEM[:transition_time]
- end
- #----------------------------------------------------------------------------
- # ○ new method:execute_splash_screen
- #----------------------------------------------------------------------------
- def execute_splash_screen
- # still in working
- end
- #----------------------------------------------------------------------------
- # ○ new method: create_graphics
- #----------------------------------------------------------------------------
- def create_graphics
- #condition if Lunatic backgroud is present
- if $imported["YEL-MenuLuna-Background"]
- create_background if SYSTEM[:lunatic_background]
- end
- create_non_luna_background if !SYSTEM[:lunatic_background]
- create_title
- create_command_window
- #condition if luna particles is present
- create_particles if $imported["NK-LunaParticles"]
- end
- #----------------------------------------------------------------------------
- # ○ new method: create_non_luna_background
- #----------------------------------------------------------------------------
- def create_non_luna_background
- # background
- @background = Sprite.new
- @background.bitmap = Cache.title1($data_system.title1_name)
- @background.x = BACKGROUND[:back_x]
- @background.y = BACKGROUND[:back_y]
- @background.ox = @background.bitmap.width / 2
- @background.oy = @background.bitmap.height / 2
- # background 2
- @background2 = Sprite.new
- @background2.bitmap = Cache.title2($data_system.title2_name)
- @background2.x = BACKGROUND[:back2_x]
- @background2.y = BACKGROUND[:back2_y]
- @background2.ox = @background2.bitmap.width / 2
- @background2.oy = @background2.bitmap.height / 2
- end
- #----------------------------------------------------------------------------
- # ○ new method: create_title
- #----------------------------------------------------------------------------
- def create_title
- #loading filename
- title_bitmap = Cache.title2(TITLE[:bitmap])
- #creating sprite
- @title = Sprite.new
- #setting sprite filename
- @title.bitmap = title_bitmap
- # getting condition if :bitmap == ""
- if TITLE[:bitmap] == ""
- draw_text_title
- else
- draw_sprite_title
- end
- end
- def draw_text_title
- @text = Sprite.new
- @text.z = 100
- @text.bitmap = Bitmap.new(Graphics.width, Graphics.height)
- @text.bitmap.font.size = TITLE[:size]
- @text.bitmap.font.name = TITLE[:font]
- @text.bitmap.font.italic = TITLE[:italic]
- @text.bitmap.font.bold = TITLE[:bold]
- @text.bitmap.font.outline = TITLE[:outline]
- @text.x = TITLE[:x]
- @text.y = TITLE[:y]
- rect = Rect.new(0, 0, Graphics.width, Graphics.height / 2)
- @text.bitmap.draw_text(rect, $data_system.game_title, 1)
- end
- #----------------------------------------------------------------------------
- # ○ new method: draw_sprite_title
- #----------------------------------------------------------------------------
- def draw_sprite_title
- #setting sprite configuration
- @title.x = TITLE[:x]
- @title.y = TITLE[:y]
- @title.z = TITLE[:z]
- #@title.wave_amp
- end
- #--------------------------------------------------------------------------
- # ● overwrite method: create_command_window
- #--------------------------------------------------------------------------
- #~ def create_command_window
- #~ case COMMANDS[:command_type]
- #~ when :default
- #~ create_default_window_command
- #~ when :horizontal
- #~ create_horizontal_command
- #~ when :clockwise
- #~ create_clockwise_command
- #~ when !:default,:horizontal, :clockwise
- #~ msgbox_p("Nil error : Please enter a valid
- #~ command option.")
- #~ SceneManager.exit
- #~ end
- #~ end
- #--------------------------------------------------------------------------
- # ● overwrite method: terminate
- #--------------------------------------------------------------------------
- def terminate
- super
- SceneManager.snapshot_for_background
- dispose_background if SYSTEM[:lunatic_background]
- dispose_non_luna_background
- dispose_text_title if TITLE[:bitmap] == ""
- dispose_sprite_title
- end
- def dispose_text_title
- @text.dispose
- @text.bitmap.dispose
- end
- #----------------------------------------------------------------------------
- # ○ new method: dispose_non_luna_background
- #----------------------------------------------------------------------------
- def dispose_non_luna_background
- @background.dispose
- @background.bitmap.dispose
- @background2.dispose
- @background2.bitmap.dispose
- end
- #----------------------------------------------------------------------------
- # ○ new method: dispose_sprite_title
- #----------------------------------------------------------------------------
- def dispose_sprite_title
- @title.dispose
- @title.bitmap.dispose
- end
- #==============================================================================
- def execute_base
- if $imported["YEL-MenuLuna"] or $imported["YEL-BattleLuna"]
- @check = true
- else
- @check = false
- end
- consequence
- end
- def consequence
- case @check
- when false
- RPG::SE.new("buzzer1",100,100).play
- msgbox_p("ERROR : Please install Menu luna or Battle Luna script in your script editor")
- exit
- end
- end
- #==============================================================================
- end # end Scene_title
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # Scene_Title
- # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- class Window_TitleCommand < Window_Command
- include Nio_luna::Title_screen
- #--------------------------------------------------------------------------
- # ● overwrite method: initialize
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0)
- update_placement
- select_symbol(:continue) if continue_enabled
- self.openness = 0
- check_opacity
- open
- end
- #----------------------------------------------------------------------------
- # ○ new method: check_opacity
- #----------------------------------------------------------------------------
- def check_opacity
- self.opacity = COMMANDS[:opacity]
- end
- #--------------------------------------------------------------------------
- # ● overwrite method: update_placement
- #--------------------------------------------------------------------------
- def update_placement
- self.x = COMMANDS[:x]
- self.y = COMMANDS[:y]
- end
- end #end Window_TitleCommand
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement