Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
- # Press Any Key Script
- # Version 1.02
- # Author : LiTTleDRAgo
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
- ($imported ||= {})[:press_any_key] = 1.02
- #==============================================================================
- # ** Window_Command
- #------------------------------------------------------------------------------
- # This window deals with general command choices.
- #==============================================================================
- class Window_Command < Window_Selectable
- VX = defined? Window_ActorCommand
- VXA = defined? Window_BattleActor
- FONTNAME = ['Calibri','Arial',Font.default_name].flatten
- FONTSIZE = 30
- FONTBOLD = false
- FONTITALIC = true
- TEXT = 'Press Any Button'
- POS = [0,330] # Position X and Y
- ALIGN = 1 # 0 = left, 1 = center, 2 = right
- WAIT = 10 # Wait time from each changing color
- $@ || alias_method(:init_drgprs, :initialize)
- define_method(:scene) { VXA ? SceneManager.scene : $scene }
- def initialize(*args)
- scene.is_a?(Scene_Title) && press_any_button
- init_drgprs(*args)
- end
- def create_press_any
- @spr = [Sprite.new,Sprite.new]
- @spr[0].bitmap = s = Graphics.respond_to?(:snap_to_bitmap) ?
- Graphics.snap_to_bitmap : Bitmap.new(640,480)
- s.font.size = FONTSIZE
- s.font.name = FONTNAME
- s.font.bold = FONTBOLD
- s.font.italic = FONTITALIC
- s.draw_text(POS[0], POS[1]-230, s.width, s.height,[s.clear] && TEXT, ALIGN)
- @spr[1].bitmap = z = @spr[0].bitmap.dup
- if s.respond_to?(:draw_edging_text) && [z.clear]
- z.draw_edging_text(POS[0], POS[1]-230, s.width, s.height, TEXT, ALIGN)
- end
- @spr.each_with_index {|s,i| s.z = i == 0 ? 100 : 70 }
- end
- def update_input_press_basic
- return press_any_key if $imported[:drg_core_engine]
- return true if Input.trigger?(Input::A)
- return true if Input.trigger?(Input::B)
- return true if Input.trigger?(Input::C)
- return true if Input.trigger?(Input::X)
- return true if Input.trigger?(Input::Y)
- return true if Input.trigger?(Input::Z)
- return true if Input.trigger?(Input::L)
- return true if Input.trigger?(Input::R)
- end
- def press_any_button
- [Graphics.transition(0), play_title_se]
- [create_press_any, update_press_any]
- end
- def play_title_se
- return scene.play_title_music if VX
- $game_system.bgm_play($data_system.title_bgm)
- end
- def update_press_any
- until update_input_press_basic
- update_change_color && [Graphics,Input].each {|s| s.update }
- end
- sound_play_ok
- @spr[0].bitmap.blt(0,0,s = [@spr[0].bitmap.clear] && @spr[1].bitmap,s.rect)
- while (@spr[0].opacity > 0 || @spr[1].opacity > 0)
- @spr.each_with_index {|s,i| s.x = i == 0 ? s.x - 2 : s.x + 2 }
- @spr.each_with_index {|s,i| s.opacity -= 3 }
- [Graphics,Input].each {|s| s.update }
- end
- @spr.each {|s| [s.bitmap.dispose, s.dispose] }.clear
- end
- def sound_play_ok
- return VXA ? Sound.play_ok : Sound.play_decision if VX
- $game_system.se_play($data_system.decision_se)
- end
- def update_change_color
- @item_max = ((@item_max || 0) + 1) % 240
- rgb = [rand(255),rand(255),rand(255)]
- [@item_max % WAIT == 0 && @spr[0].flash(Color.new(*rgb),1)]
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement