Jump to content
BlueTyphlosion

HK Animated Title v1 Translated to Ace

Recommended Posts

Introduction
This is the same hk animated title script made for vx but translated to vxace by me, BlueTyphlosion.
 
Script
 
For those who prefer the script without the images.


 

#==============================================================================
#  Hanzo Kimura's Animated Title Screen    (Translated by BlueTyphlosion)
#  Scripted Date: 02/24/09
#  PLEASE CREDIT: Hanzo Kimura
#  if Your going to use this script for your title
#
#  IMAGES USED(All in Graphics/System) Folder:
#     "TitleBGLoop.jpg" - For Scrolling Upward Effect
#     "TitleBGSprite.jpg" - For Horizantally Endless Scrolling 
#     "TitleCursor.png" - For the title cursor
#     "TitleMenu01.png" - For the title Menu (First Menu Active)
#     "TitleMenu02.png" - For the title Menu (Second Menu Active)
#     "TitleMenu03.png" - For the title Menu (Third Menu Active)
#     "TitleLogo.png" - For the Title Logo
#     "TitleSpark01.png" - For the Title Spark
#     "TitleSpark02.png" - For the Title Spark
#     "TitleSymbol.png" - For the Title Symbol
#     "TitleCursorStrike01.png" - For Title Cursor Strike Effect(Left)
#     "TitleCursorStrike02.png" - For Title Cursor Strike Effect(Right)
#   **"TitleBG.jpg" - For Still Version Title Background
#
#  UPDATE #1
#  ***New Function Added '$STILL_BG' Let's you control the Background behavior
#     Set it to True if you want the Animated Waving Effect,
#     Set it to False if you want a Still Background
#  ***640x480 Version Added 
#
#  IF YOU FIND ANY BUGS REPORT HERE:
#  http://www.rpgmakervx.net/index.php?showtopic=16133&st=60 
#
#==============================================================================
#NEW FUNCTION
$STILL_BG = false       # true=Still Background false=Animated Background
                        #'TitleBG' is the filename that will be used for Still BG

$TITLE_MENU_X = 184     # Your Title Menu X Position
$TITLE_MENU_Y = 260     # Your Title Menu Y Position
$LOGO_X = 0             # Your Logo X Position
$LOGO_Y = 0             # Your Logo Y Position
$SPARK_COUNT = 350      # SPARK COUNT: Frames Before the Spark Appears again
$SPARK_SPEED = 10       # The Speed of the Sparks
$MENU_NEW = 260         # THE Y Position of the Cursor if NEW GAME
$MENU_CONTINUE = 305    # THE Y Position of the Cursor if CONTINUE
$MENU_EXIT = 345           # THE Y Position of the Cursor if EXIT
$SYMBOL_SPEED = 1


#DONT EDIT BELOW
$titleloop = 1
$SYMBOL_RESET = false
#------------------------------------------------------------------------------
#  This class performs the title screen processing.
#==============================================================================
class Scene_Title < Scene_Base
  def start
    super
    SceneManager.clear
    Graphics.freeze
    create_command_window
    create_title_background
    play_title_music
  end
  alias create_command_window_hk create_command_window
  def create_command_window
    create_command_window_hk
    @command_window.visible = false
  end
  def update
    super
    if $STILL_BG == false
     @wave.update
    if @sprite.oy != 0
      @sprite.oy -= 1
    elsif @sprite.oy == 0
      @sprite.ox += 1
    end
    if @wave.oy != 0
      @wave.oy -= 1
    elsif @wave.oy == 0
      if $TITLE_LOOP == 1 && @wave.ox != 1289
        @wave.ox += 1
      else
        $TITLE_LOOP == 2
      end
      if $TITLE_LOOP == 2 && @wave.ox != -1189
        @wave.ox -= 1
      else
        $TITLE_LOOP == 1
      end
    end
   end
     @symbol.ox -= $SYMBOL_SPEED
     if $SYMBOL_RESET == true && @symbol.opacity == 0
          $SYMBOL_RESET = false
        elsif @symbol.opacity != 255
          @symbol.opacity += 3
        end
     #=======Spark Animation========
     @spark01.x += $SPARK_SPEED
     @spark02.x -= $SPARK_SPEED
     if $SPARK_COUNT != 0
       $SPARK_COUNT -= 1
     else
       $SPARK_COUNT = 350
       @spark01.x = -172
       @spark02.x = 544
     end
     if @spark01.opacity != 255
       @spark01.opacity += 20
       @spark02.opacity += 20
     end
    #=======Menu Animation=========
    case @command_window.index
      when 0
        @spark01.y = $MENU_NEW - 20
        @spark02.y = $MENU_NEW
        @symbol.oy = $MENU_NEW + 183
        @strike1.y = $MENU_NEW
        @strike2.y = $MENU_NEW
        if @menu01.opacity != 255
          @menu01.opacity += 20
          @menu02.opacity -= 20
          @menu03.opacity -= 20
        end
        if @cursor.y != $TITLE_MENU_Y
          @cursor.y -= 5
          end
      when 1
        @spark01.y = $MENU_CONTINUE - 20
        @spark02.y = $MENU_CONTINUE
        @symbol.oy = $MENU_CONTINUE + 93
        @strike1.y = $MENU_CONTINUE
        @strike2.y = $MENU_CONTINUE
        if @menu02.opacity != 255
          @menu02.opacity += 20
          @menu01.opacity -= 20
          @menu03.opacity -= 20
        end
        if @cursor.y != $MENU_CONTINUE && @cursor.y < $MENU_CONTINUE
          @cursor.y += 5
          elsif @cursor.y != $MENU_CONTINUE && @cursor.y > $MENU_CONTINUE
          @cursor.y -= 5
          end
      when 2
        @spark01.y = $MENU_EXIT - 20
        @spark02.y = $MENU_EXIT
        @symbol.oy = $MENU_EXIT + 13
        @strike1.y = $MENU_EXIT
        @strike2.y = $MENU_EXIT
        if @menu03.opacity != 255
          @menu03.opacity += 20
          @menu02.opacity -= 20
          @menu01.opacity -= 20
        end
        if @cursor.y != $MENU_EXIT
          @cursor.y += 5
        end
      end
  if @strike1.x != 0
    @strike1.x += 11
  end
  if @strike2.x != 212
    @strike2.x -= 12
  end
      check_menu
    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
  #--------------------------------------------------------------------------
  # * Checking Current Menu
  #--------------------------------------------------------------------------
  def check_menu
    if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN)
      $SPARK_COUNT = 350
      @spark01.x = -172
      @spark02.x = 544
      @spark01.opacity -= 255
      @spark02.opacity -= 255
      @symbol.opacity -= 255
      $SYMBOL_RESET = true
    case @command_window.index
      when 0
        @spark01.y = 280
        @spark02.y = 300
        @symbol.oy = 403
        @strike1.y = 300
        @strike2.y = 300
        @strike1.x = -330
        @strike2.x = 584
      when 1
        @spark01.y = 325
        @spark02.y = 345
        @symbol.oy = 358
        @strike1.y = 345
        @strike2.y = 345
        @strike1.x = -330
        @strike2.x = 584
      when 2
        @spark01.y = 365
        @spark02.y = 385
        @symbol.oy = 317
        @strike1.y = 385
        @strike2.y = 385
        @strike1.x = -330
        @strike2.x = 584
      end
    end
  end
  def create_title_background
    @viewport1 = Viewport.new(0, 0, 1288, 891)
    @viewport2 = Viewport.new(0, 0, 824, 480)
    @viewport2.z = 10
    if $STILL_BG == false
    @sprite = Plane.new(@viewport1)
    @sprite.bitmap = Cache.system("TitleBGLoop")
    @sprite.oy = 371
    @sprite.ox = 100
    @sprite.z = -100
    @wave = Sprite.new(@viewport1)
    @wave.bitmap = Cache.system("TitleBGSprite")
    @wave.oy = 371
    @wave.ox = 100
    @wave.wave_amp = 50
    @wave.wave_length = 440
    @wave.wave_speed = 1250   
    @wave.opacity = 125
    @wave.z = 5
  else
    @sprite = Sprite.new
    @sprite.bitmap = Cache.system("TitleBG")
    @sprite.y = 0
    @sprite.x = 0
    @sprite.z = -100
  end
    @logo = Sprite.new
    @logo.bitmap = Cache.system("TitleLogo")
    @logo.x = $LOGO_X
    @logo.y = $LOGO_Y
    @logo.z = 10
    @menu01 = Sprite.new
    @menu01.bitmap = Cache.system("TitleMenu01")
    @menu01.x = $TITLE_MENU_X
    @menu01.y = $TITLE_MENU_Y
    @menu02 = Sprite.new
    @menu02.bitmap = Cache.system("TitleMenu02")
    @menu02.x = $TITLE_MENU_X
    @menu02.y = $TITLE_MENU_Y
    @menu02.opacity = 0
    @menu03 = Sprite.new
    @menu03.bitmap = Cache.system("TitleMenu03")
    @menu03.x = $TITLE_MENU_X
    @menu03.y = $TITLE_MENU_Y
    @menu03.opacity = 0
    @cursor = Sprite.new
    @cursor.bitmap = Cache.system("TitleCursor")
    @cursor.x = $TITLE_MENU_X
    @cursor.y = $TITLE_MENU_Y
    @cursor.z = 12
    @strike1 = Sprite.new
    @strike1.bitmap = Cache.system("TitleCursorStrike01")
    @strike1.x = 0
    @strike1.y = 260
    @strike1.z = 9
    @strike2 = Sprite.new
    @strike2.bitmap = Cache.system("TitleCursorStrike02")
    @strike2.x = 212
    @strike2.y = 260
    @strike2.z = 9
    @symbol = Plane.new(@viewport2)
    @symbol.bitmap = Cache.system("TitleSymbol")
    @symbol.oy = 443
    @symbol.ox = 100
    @spark01 = Sprite.new
    @spark01.bitmap = Cache.system("TitleSpark01")
    @spark01.y = 280
    @spark01.x = -172
    @spark01.z = 12
    @spark02 = Sprite.new
    @spark02.bitmap = Cache.system("TitleSpark02")
    @spark02.y = 300
    @spark02.x = 544
    @spark02.z = 12
    @menu01.z = @menu02.z = @menu03.z = 13
    if @continue_enabled  
      @menu01.opacity = 0
      @menu02.opacity = 255
      @cursor.y = 305
      @strike1.y = 305
      @strike2.y = 305
      @symbol.oy = 398
    end
  end
  #--------------------------------------------------------------------------
  # * Dispose of Title Graphic
  #--------------------------------------------------------------------------
  def dispose_title_background
    if $STILL_BG == false
    @wave.dispose
    @wave.bitmap.dispose
  end
    @sprite.dispose
    @logo.dispose
    @menu01.dispose
    @menu02.dispose
    @menu03.dispose
    @cursor.dispose
    @strike1.dispose
    @strike2.dispose
    @symbol.dispose
    @spark01.dispose
    @spark02.dispose
    @logo.bitmap.dispose
    @menu01.bitmap.dispose
    @menu02.bitmap.dispose
    @menu03.bitmap.dispose
    @cursor.bitmap.dispose
    @strike1.bitmap.dispose
    @strike2.bitmap.dispose
    @spark01.bitmap.dispose
    @spark02.bitmap.dispose
  end
  def terminate
    super
    SceneManager.snapshot_for_background
    dispose_title_background
  end
end
 

 

 

 

 

For those who wish to have the images also.

System.zip

 

 

Credits

  • Hanzo Kimura (for original vx script)
  • ShinGamix (for requesting v1 to be translated in original post)
  • BlueTyphlosion (for the translation)

UPDATE!

  • Fixed a few minor alignment errors with images.
Edited by BlueTyphlosion

Share this post


Link to post
Share on other sites

Is there a way to disable the need for certain images? I only want the screen to scroll horizontally and the menu options, I don't care much for the wave or sparks, cursor, ect. (well, I like the features but I would like to disable them for this project) If I only import TitleBGSprite and TitleMenu01-3 I get file not found errors until I import an image for each variable. 

 

Edit- just realized the horizontal image is the scrolling ticker. This script might not work for this after all, but it's definitely going in my other project.

Edited by G4M5T3R

Share this post


Link to post
Share on other sites

is there a video tutorial anywhere that shows you how to set up the animated title screen?

 

There is an error on Line 76 when you choose Continue.

It wont even let me continue becuae it cannot find TitleBGloop? Its in the system folder Im just not sure why it cannot find it?

Edited by Galv

Share this post


Link to post
Share on other sites

GIJhen, please don't double post within 72 hours. Edit your previous post instead using the edit link (located to the left of the quote button in your post). I have merged your posts now. Thanks.

Share this post


Link to post
Share on other sites

is there a video tutorial anywhere that shows you how to set up the animated title screen?

 

There is an error on Line 76 when you choose Continue.

It wont even let me continue becuae it cannot find TitleBGloop? Its in the system folder Im just not sure why it cannot find it?

 

It seems like you're missing a Capital "L" in Loop.

Check your script and your folder and make sure the names are "TitleBGLoop" and not "TitleBGloop".

 

I can't really help you since I don't really use these title screens anymore, I actually make my own now.

Share this post


Link to post
Share on other sites

I have used it several times in multiple projects. It's perfect.

 

If you got the picture named right then you must have changed the code by accident or not posted it fully.

Also make sure you have all the images in the correct folder.

Edited by ShinGamix

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×