VX 스크립트

KGC 라이브러리 중에서 빼와서 설명을 덧붙였습니다.

중복이 있으면 중복이라고 댓글 써주시면 삭제하겠습니다(KGC라고 했는데 안나와서요..)

 

 

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/   ◆                  Splash Logo - KGC_TitleDirection                ◆ VX ◆
#_/   ◇                       Last Update: 2008/09/06                         ◇
#_/   ◆                    Translation by Mr. Anonymous                       ◆
#_/   ◆ KGC Site:                                                             ◆
#_/   ◆ http://f44.aaa.livedoor.jp/~ytomy/                                    ◆
#_/   ◆ Translator's Blog:                                                    ◆
#_/   ◆ http://mraprojects.wordpress.com                                      ◆
#     ◆ 타이틀 전에 로고를 띄워주는 스크립트입니다.
#_/----------------------------------------------------------------------------
#_/   This script adds a function to display a splash logo before the title
#_/  screen is displayed. A sample of this effect is provided with the demo
#_/  this script came packaged in.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

#==============================================================================
#                             ★ Customization ★
#==============================================================================

module KGC
module TitleDirection
  #                        ◆ Start Title BGM Timing ◆
  # This allows you to adjust when the title screen BGM is played.
  #   0..Before Logo  1..After Logo # 타이틀 음악이 재생될 구간을 정해주세요. 0.. 로고 나오기 전 1.. 로고가 나온 후(권장)
  BGM_TIMING = 1

  #                 ◆ Show Logo During Testplay (DEBUGGING) ◆
  # This toggle allows you to bypass the logo display when debugging. # 테스트 플레이(디버깅)에도 로고를 재생할 지 정해주세요.
  TESTPLAY_SHOW = true
 
  #                         ◆ 띄울 로고 그래픽(Graphics/System/) ◆
  #  Here, you may specify the image file you'd like to use as a logo.
  # The image must be in the "Graphics/System" folder.
  # Setting this to nil will display nothing. If set to nil, the Splash Logo
  #  Sound Effect defined below is also assumed to be nil.
  # 띄우실 로고 그림파일을 적어주세요. Graphics/System 폴더 안에 있어야 합니다.
  SPLASH_LOGO_FILE = "Logo"
 
  #                       ◆ 로고 띄울시 나오는 사운드(Audio/SE/) ◆
  # Here, you may specify a sound effect to play while the splash logo displays.
  # This can be written two ways. First, you can simply define a filename and
  #  the script automatically assumes to look in the SE folder and assign
  #  default values for volume and pitch, as such:  
  #     SPLASH_LOGO_SE = "start_logo"
  #  Or class notation, allowing for additional customization, as such:
  #   SPLASH_LOGO_SE = RPG::SE.new("start_logo", 80, 100)
  # 로고가 띄워질 시 재생될 SE파일과 음향,속도를 정하세요. Audio/SE에 있어야 합니다.
  SPLASH_LOGO_SE = RPG::SE.new("Saint6", 100, 70)
 
  #                           ◆ 로고 띄우는 방식 ◆
  #  로고를 띄우고 전환하는 방식을 선택하세요.
  #  이해를 돕기 위해 자세히 기록했습니다.
  #   0..띄우고 전환  1..왼쪽과 오른쪽에서 만남  2..안에서 밖으로 로고 빼내기
  #   3..나온 후 4방향으로 갈라짐
  SPLASH_LOGO_TYPE = 2
  end
end
#=============================================================================#
#                          ★ End Customization ★                              #
#=============================================================================#

#=================================================#
#                    IMPORT                       #
#=================================================#

$imported = {} if $imported == nil
$imported["TitleDirection"] = true

#=================================================#

#==============================================================================
# □ Sprite_TitleLogo
#------------------------------------------------------------------------------
#   タイトル画面のロゴを扱うクラスです。
#==============================================================================

class Sprite_TitleLogo < Sprite
  attr_accessor :effect_no_out  # 消去エフェクトなし
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super
    @effect_type = 0
    @effect_duration = 0
    @effect_sprites = []
    @effect_no_out = false
  end
  #--------------------------------------------------------------------------
  # ● 破棄
  #--------------------------------------------------------------------------
  def dispose
    super
    dispose_effect_sprites
  end
  #--------------------------------------------------------------------------
  # ○ エフェクト用スプライト破棄
  #--------------------------------------------------------------------------
  def dispose_effect_sprites
    @effect_sprites.each { |s| s.dispose }
    @effect_sprites = []
  end
  #--------------------------------------------------------------------------
  # ● Z 座標変更
  #--------------------------------------------------------------------------
  def z=(value)
    super(value)
    @effect_sprites.each { |s| s.z = value }
  end
  #--------------------------------------------------------------------------
  # ○ フェード効果
  #     dx : X 座標
  #     dy : Y 座標
  #     bitmap : 表示画像
  #--------------------------------------------------------------------------
  def effect_fade(dx, dy, bitmap)
    dispose_effect_sprites
    @effect_type = 0
    @effect_duration = 150
    # スプライト作成
    sprite = Sprite.new
    sprite.bitmap = bitmap
    # 表示位置を調整
    sprite.x = dx
    sprite.y = dy
    sprite.ox = bitmap.width / 2
    sprite.oy = bitmap.height / 2
    sprite.opacity = 0

    @effect_sprites << sprite
  end
  #--------------------------------------------------------------------------
  # ○ クロス効果
  #--------------------------------------------------------------------------
  def effect_cross(dx, dy, bitmap)
    dispose_effect_sprites
    @effect_type = 1
    @effect_duration = 150
    # スプライト作成
    sprites = [Sprite.new, Sprite.new]
    sprites[0].bitmap = bitmap
    sprites[1].bitmap = bitmap
    # 表示位置を調整
    sprites[0].x = dx - 240
    sprites[1].x = dx + 240
    sprites[0].y = dy
    sprites[1].y = dy
    sprites[0].ox = sprites[1].ox = bitmap.width / 2
    sprites[0].oy = sprites[1].oy = bitmap.height / 2
    sprites[0].opacity = 0
    sprites[1].opacity = 0

    @effect_sprites += sprites
  end
  #--------------------------------------------------------------------------
  # ○ ズーム効果
  #--------------------------------------------------------------------------
  def effect_zoom(dx, dy, bitmap)
    dispose_effect_sprites
    @effect_type = 2
    @effect_duration = 150
    # スプライト作成
    sprites = [Sprite.new, Sprite.new]
    sprites[0].bitmap = bitmap
    sprites[1].bitmap = bitmap
    # 初期設定
    sprites[0].x = sprites[1].x = dx
    sprites[0].y = sprites[1].y = dy
    sprites[0].ox = sprites[1].ox = bitmap.width / 2
    sprites[0].oy = sprites[1].oy = bitmap.height / 2
    sprites[0].zoom_x = sprites[0].zoom_y = 0.0
    sprites[1].zoom_x = sprites[1].zoom_y = 6.0
    sprites[0].opacity = sprites[1].opacity = 0

    @effect_sprites += sprites
  end
  #--------------------------------------------------------------------------
  # ○ スプラッシュ効果
  #--------------------------------------------------------------------------
  def effect_splash(dx, dy, bitmap)
    dispose_effect_sprites
    @effect_type = 3
    @effect_duration = 150
    # スプライト作成
    sprites = [Sprite.new]
    sprites[0].bitmap = bitmap
    # 初期設定
    sprites[0].ox = bitmap.width >> 1
    sprites[0].oy = bitmap.height >> 1
    sprites[0].x = dx
    sprites[0].y = dy
    sprites[0].opacity = 0
    (1..3).each { |i|
      sprites[i] = Sprite.new
      sprites[i].bitmap = bitmap
      sprites[i].ox = sprites[0].ox
      sprites[i].oy = sprites[0].oy
      sprites[i].x = dx
      sprites[i].y = dy
      sprites[i].opacity = 255
      sprites[i].visible = false
    }

    @effect_sprites += sprites
  end
  #--------------------------------------------------------------------------
  # ○ スプラッシュイン効果
  #--------------------------------------------------------------------------
  def effect_splash_in(dx, dy, bitmap)
    dispose_effect_sprites
    @effect_type = 4
    @effect_duration = 41
    # スプライト作成
    sprites = [Sprite.new]
    sprites[0].bitmap = bitmap
    # 初期設定
    sprites[0].ox = bitmap.width >> 1
    sprites[0].oy = bitmap.height >> 1
    sprites[0].x = dx - 160
    sprites[0].y = dy - 160
    sprites[0].opacity = 0
    (1..3).each { |i|
      sprites[i] = Sprite.new
      sprites[i].bitmap = bitmap
      sprites[i].ox = sprites[0].ox
      sprites[i].oy = sprites[0].oy
      sprites[i].x = dx
      sprites[i].y = dy
      sprites[i].opacity = 0
    }
    sprites[1].x += 160
    sprites[1].y -= 160
    sprites[2].x += 160
    sprites[2].y += 160
    sprites[3].x -= 160
    sprites[3].y += 160

    @effect_sprites += sprites
  end
  #--------------------------------------------------------------------------
  # ○ エフェクト停止
  #--------------------------------------------------------------------------
  def stop_effect
    dispose_effect_sprites
    @effect_duration = 0
  end
  #--------------------------------------------------------------------------
  # ○ エフェクト実行中判定
  #--------------------------------------------------------------------------
  def effect?
    return @effect_duration > 0
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    super

    if @effect_duration > 0
      update_effect
    end
  end
  #--------------------------------------------------------------------------
  # ○ エフェクト更新
  #--------------------------------------------------------------------------
  def update_effect
    @effect_duration -= 1
    case @effect_type
    when 0
      update_effect_fade
    when 1
      update_effect_cross
    when 2
      update_effect_zoom
    when 3
      update_effect_splash
    when 4
      update_effect_splash_in
    end
  end
  #--------------------------------------------------------------------------
  # ○ エフェクト更新 : フェード
  #--------------------------------------------------------------------------
  def update_effect_fade
    case @effect_duration
    when 100...150
      @effect_sprites[0].opacity += 6
    when 30...100
      # 何もしない
    when 0...30
      unless @effect_no_out
        @effect_sprites[0].opacity -= 10
      end
    end
  end
  #--------------------------------------------------------------------------
  # ○ エフェクト更新 : クロス
  #--------------------------------------------------------------------------
  def update_effect_cross
    case @effect_duration
    when 110...150
      @effect_sprites[0].x += 6
      @effect_sprites[1].x -= 6
      @effect_sprites[0].opacity += 4
      @effect_sprites[1].opacity += 4
    when 30...110
      @effect_sprites[0].opacity = 255
      @effect_sprites[1].visible = false
    when 0...30
      unless @effect_no_out
        @effect_sprites[0].opacity -= 13
      end
    end
  end
  #--------------------------------------------------------------------------
  # ○ エフェクト更新 : ズーム
  #--------------------------------------------------------------------------
  def update_effect_zoom
    case @effect_duration
    when 100...150
      @effect_sprites[0].zoom_x = (@effect_sprites[0].zoom_y += 0.02)
      @effect_sprites[1].zoom_x = (@effect_sprites[1].zoom_y -= 0.1)
      @effect_sprites[0].opacity += 3
      @effect_sprites[1].opacity += 3
    when 30...100
      @effect_sprites[0].opacity = 255
      @effect_sprites[1].visible = false
    when 0...30
      unless @effect_no_out
        @effect_sprites[0].opacity -= 13
      end
    end
  end
  #--------------------------------------------------------------------------
  # ○ エフェクト更新 : スプラッシュ
  #--------------------------------------------------------------------------
  def update_effect_splash
    case @effect_duration
    when 90...150
      @effect_sprites[0].opacity += 5
    when 0...60
      @effect_sprites[0].x -= 2
      @effect_sprites[0].y -= 2
      @effect_sprites[1].x += 2
      @effect_sprites[1].y -= 2
      @effect_sprites[2].x += 2
      @effect_sprites[2].y += 2
      @effect_sprites[3].x -= 2
      @effect_sprites[3].y += 2
      4.times { |j|
        @effect_sprites[j].visible = true
        @effect_sprites[j].opacity -= 5
      }
    end
  end
  #--------------------------------------------------------------------------
  # ○ エフェクト更新 : スプラッシュイン
  #--------------------------------------------------------------------------
  def update_effect_splash_in
    case @effect_duration
    when 1...41
      @effect_sprites[0].x += 2
      @effect_sprites[0].y += 2
      @effect_sprites[1].x -= 2
      @effect_sprites[1].y += 2
      @effect_sprites[2].x -= 2
      @effect_sprites[2].y -= 2
      @effect_sprites[3].x += 2
      @effect_sprites[3].y -= 2
      4.times { |j|
        @effect_sprites[j].opacity += 3
      }
    when 0
      @effect_sprites[0].opacity = 255
      (1..3).each { |i|
        @effect_sprites[i].visible = false
      }
    end
  end
end

#★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★

#==============================================================================
# ■ Scene_Title
#==============================================================================

class Scene_Title < Scene_Base
  #--------------------------------------------------------------------------
  # ● 開始処理
  #--------------------------------------------------------------------------
  alias start_KGC_TitleDirection start
  def start
    show_splash_logo

    start_KGC_TitleDirection
  end
  #--------------------------------------------------------------------------
  # ○ スプラッシュロゴ表示
  #--------------------------------------------------------------------------
  def show_splash_logo
    return if $__splash_logo_shown
    return if $TEST && !KGC::TitleDirection::TESTPLAY_SHOW
    return if KGC::TitleDirection::SPLASH_LOGO_FILE == nil

    play_title_music if KGC::TitleDirection::BGM_TIMING == 0

    # ロゴ表示 SE 演奏
    if KGC::TitleDirection::SPLASH_LOGO_SE != nil
      if KGC::TitleDirection::SPLASH_LOGO_SE.is_a?(RPG::SE)
        KGC::TitleDirection::SPLASH_LOGO_SE.play
      elsif KGC::TitleDirection::SPLASH_LOGO_SE.is_a?(String)
        se = RPG::SE.new(KGC::TitleDirection::SPLASH_LOGO_SE)
        se.play
      end
    end

    # エフェクト用スプライト作成
    sprite = Sprite_TitleLogo.new
    bitmap = Cache.system(KGC::TitleDirection::SPLASH_LOGO_FILE)
    dx = Graphics.width / 2
    dy = Graphics.height / 2

    # エフェクト準備
    case KGC::TitleDirection::SPLASH_LOGO_TYPE
    when 0
      sprite.effect_fade(dx, dy, bitmap)
    when 1
      sprite.effect_cross(dx, dy, bitmap)
    when 2
      sprite.effect_zoom(dx, dy, bitmap)
    when 3
      sprite.effect_splash(dx, dy, bitmap)
    end
    # エフェクト実行
    Graphics.transition(0)
    while sprite.effect?
      Graphics.update
      Input.update
      sprite.update
      # C ボタンで中止
      if Input.trigger?(Input::C)
        sprite.stop_effect
      end
    end
    # 後始末
    sprite.dispose
    bitmap.dispose
    # トランジション準備
    Graphics.freeze

    $__splash_logo_shown = true
  end
end


Comment '5'
  • ?
    하란 2011.01.05 16:51

    괜찮은 스크립트네요 ㅎㅎ 잘 사용하겠습니다

  • ?
    시트르산 2011.01.14 17:05

    저도 썼었던 스크립트네요 ㅎㅎ

    간단하면서도 나쁘지 않은 타이틀을 쉽게 만들어주는 스크립트죠 ㅎㅎ

  • ?
    KMS 2011.01.17 18:20

    요즘 좋은 스크립트 많이 얻고 가네요...감사합니다!

  • ?
    츠코미 2011.01.21 18:43

    좋은 스크립트 잘 쓰겠습니다 ^^

  • ?
    그린2 2013.02.11 19:52
    너무 빨리 넘어가는 것 같은데 좀 느리게 할 순 없나요?

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5408
637 전투 VLAD ABS [액알 시스템] 65 아방스 2009.01.07 12566
636 전투 vampyr SBABS-Requiem ABS 9(액알) 101 file 담먹캐 2009.11.01 12005
635 HUD rpg 만들기 vx - 맵이름 띠우는 스크립트 ^^ 74 아방스 2008.01.27 11929
634 HUD PRABS v1.0 [hud,주석액알,원거리공격,hotkeys,vx] 대박감이다. 47 유칸지 2008.08.13 11114
633 전투 사이드뷰배틀3.3 + ATB1.1 스크립트. 65 할렘 2009.02.01 10946
632 전투 ORBS [새로운 전투 방식] 48 file 아방스 2009.03.04 10210
631 그래픽 3D그래픽 파티클엔진 45 file RPGbooster 2008.10.08 10130
630 전투 rpgvx 간단액알 스크립트 제작: 41 *PS 2008.02.07 9824
629 메뉴 (모그메뉴 풀세트팩 SEL Style.) 유니크급 자료 147 file 할렘 2009.02.07 9558
628 전투 RPG Tankentai SBS 3.3 + ATB Kaduki Eng 58 아방스 2009.02.05 9071
627 전투 ATB전투방식.(사이드뷰X 백발의카임전투방식O) 14 file 이피쿤 2009.06.24 9035
626 메뉴 일본에서 만든 멋있는메뉴변경 스크립트 (한글 VX에서 쓰시면 자동으로 바뀜) 45 유칸지 2008.04.09 8861
625 전투 WGB배틀 시스템. 59 file 카르와푸딩의아틀리에 2009.06.30 8777
624 전투 Crissaegrim ABS 2.0.5 최신 48 file RPGbooster 2008.10.08 8768
623 전투 Requiem ABS 8 - 액션 배틀 시스템 8 36 아방스 2009.06.24 8540
622 전투 RPGTankentai SBS3.3b 버전 (사이드뷰) 21 file 카르와푸딩의아틀리에 2009.07.01 8455
621 전투 사이드뷰 스크립트 [2003 전투 방식] 39 아방스 2008.03.09 8406
620 맵/타일 RPG 만들기 VX 로 구현한 3D~ 42 아방스 2008.09.02 8405
619 메뉴 메뉴변경 스크립트 34 아방스 2008.01.24 7939
618 전투 PRABS 2.0 액션배틀시스템 58 file RPGbooster 2008.10.08 7575
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 32 Next
/ 32