Advertisement
CompanionWulf

Q-Engine Animated Title Add-On (RMVX)

Mar 14th, 2015
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 26.02 KB | None | 0 0
  1. =begin
  2. ╔══════════════════════════════════════════════════════════════════════════════╗
  3. ║ Q-Engine Animated Title Add-On Version 2.0a (QES-ATA)                        ║
  4. ╟──────────────────────────────────────────────────────────────────────────────╢
  5. ║   Version         : 2.0.0a                                                   ║
  6. ║   Author          : Companion Wulf                                           ║
  7. ║   Platform        : RMVX                                                     ║
  8. ║   Inception Date  : 18 December 2013                                         ║
  9. ║   Release Date    : 10 March 2015                                            ║
  10. ║   Last Update     : 29 September 2014                                        ║
  11. ║   Demo Version    : N/A                                                      ║
  12. ║   Demo Date       : N/A                                                      ║
  13. ║   Website         : http://rpgmakertimes.info                                ║
  14. ║   Blog            : http://blog.rpgmakertimes.info                           ║
  15. ║                                                                              ║
  16. ╠══════════════════════════════════════════════════════════════════════════════╣
  17. ║ ◄ DESCRIPTION ►                                                              ║
  18. ╟──────────────────────────────────────────────────────────────────────────────╢
  19. ║     The Q-Engine  incorporates all of the  scripts from the former           ║
  20. ║     Scripts/Add-Ons Compendium,  but with  additional options,  as           ║
  21. ║     well as extra functions and features.                                    ║
  22. ║                                                                              ║
  23. ║     The Q-Engine  Animated Title Add-On  adds a fully customizable           ║
  24. ║     animated  multi-layered title screen. This was originally part           ║
  25. ║     of the Q-Engine, but it was extracted as a separate add-on for           ║
  26. ║     easier expansion.                                                        ║
  27. ║                                                                              ║
  28. ╠══════════════════════════════════════════════════════════════════════════════╣
  29. ║ ◄ INSTALLATION ►                                                             ║
  30. ╟──────────────────────────────────────────────────────────────────────────────╢
  31. ║     Place after the "Q-Engine" main script.                                  ║
  32. ║                                                                              ║
  33. ║     NOTE:  See "Required Scripts" section for  additional install-           ║
  34. ║     ation notes.                                                             ║
  35. ║                                                                              ║
  36. ╠══════════════════════════════════════════════════════════════════════════════╣
  37. ║ ◄ KNOWN COMPATABILITY ISSUES ►                                               ║
  38. ╟──────────────────────────────────────────────────────────────────────────────╢
  39. ║     There may only be compatability issues for  other scripts that           ║
  40. ║     overwrite or modify the Scene_Title class.                               ║
  41. ║                                                                              ║
  42. ╠══════════════════════════════════════════════════════════════════════════════╣
  43. ║ ◄ REQUIRED SCRIPTS ►                                                         ║
  44. ╟──────────────────────────────────────────────────────────────────────────────╢
  45. ║     The following  scripts/modules are required  for the  Q-Engine           ║
  46. ║     script to work properly (in this order):                                 ║
  47. ║                                                                              ║
  48. ║     ● Global Colors Module                                                   ║
  49. ║     ● Q-Engine Script                                                        ║
  50. ║     ● Bitmap Add-On                                                          ║
  51. ║                                                                              ║
  52. ║     Optional Q-Engine add-ons should be added after these scripts.           ║
  53. ║                                                                              ║
  54. ║     NOTE:  The current manual  is out of date  and doesn't reflect           ║
  55. ║     the changes in version 4.0. When he manual has been completely           ║
  56. ║     updated,  it will also  include the  settings for  the various           ║
  57. ║     add-ons. This will be fully updated when it's complete.                  ║
  58. ║                                                                              ║
  59. ╠══════════════════════════════════════════════════════════════════════════════╣
  60. ║ ◄ MANUAL ►                                                                   ║
  61. ╟──────────────────────────────────────────────────────────────────────────────╢
  62. ║     The complete  Q-Engine manual is now  available in  DOC or PDF           ║
  63. ║     formats,  downloadable from  RPG Maker Times Companion,  along           ║
  64. ║     with a  demo showcasing  its features.                                   ║
  65. ║                                                                              ║
  66. ║     Note:  The current manual  is out of date  and doesn't reflect           ║
  67. ║     the changes in version 4.0. When he manual has been completely           ║
  68. ║     updated,  it will also  include the  settings for  the various           ║
  69. ║     add-ons. This will be fully updated when it's complete.                  ║
  70. ║                                                                              ║
  71. ╠══════════════════════════════════════════════════════════════════════════════╣
  72. ║ ◄ Q-ENGINE ANIMATED TITLE ADD-ON VERSION HISTORY ►                           ║
  73. ╟──────────────────────────────────────────────────────────────────────────────╢
  74. ║     The version history tracking will be changing to the following           ║
  75. ║     format:                                                                  ║
  76. ║                                                                              ║
  77. ║         Release.Updates.Developmental                                        ║
  78. ║                                                                              ║
  79. ║     Release numbers indicate public release versions.                        ║
  80. ║                                                                              ║
  81. ║     Updates refers to new scripts/scriptlets (both major and minor           ║
  82. ║     updates).                                                                ║
  83. ║                                                                              ║
  84. ║     Developmental updates  are for  tweaks or  bug fixes,  and new           ║
  85. ║     added methods.                                                           ║
  86. ║                                                                              ║
  87. ╟──────────────────────────────────────────────────────────────────────────────╢
  88. ║     NOTE: The QES-ATA was  originally part of the Q-Engine,  but it          ║
  89. ║     has since  become a  separate add-on to  make future  expansion          ║
  90. ║     easier.  The version history up  until version 1.0  is based on          ║
  91. ║     the original Q-Engine integration.                                       ║
  92. ║                                                                              ║
  93. ╠══════════════════════════════════════════════════════════════════════════════╣
  94. ║ * Updates Version History *                                                  ║
  95. ╟──────────────────────────────────────────────────────────────────────────────╢
  96. ║ v2.0.0a (10-Mar-2015)                                                        ║
  97. ║   ● Release: Version 2.0a (Alpha)                                            ║
  98. ╟──────────────────────────────────────────────────────────────────────────────╢
  99. ║ v2.0.0b (08-Oct-2014)                                                        ║
  100. ║   ● Release: Version 2.0b (Beta)                                             ║
  101. ╟──────────────────────────────────────────────────────────────────────────────╢
  102. ║ v1.0.2 (29-Sep-2014)                                                         ║
  103. ║   ● Tweak: Rework requirements structure, including version checker          ║
  104. ╟──────────────────────────────────────────────────────────────────────────────╢
  105. ║ v1.0.1 (18-Jul-2014)                                                         ║
  106. ║   ● Bug Fix: Issue with animated screen if Animated Title turned off         ║
  107. ╟──────────────────────────────────────────────────────────────────────────────╢
  108. ║ v1.0.0 (01-Mar-2014)                                                         ║
  109. ║   ● Update: Animated Title extracted as a separate add-on                    ║
  110. ╟──────────────────────────────────────────────────────────────────────────────╢
  111. ║ V0.4.5 (18-Nov-2013)                                                         ║
  112. ║   ● Bug Fix: -X/+X coordination animation problems on Animated Title Screen  ║
  113. ╟──────────────────────────────────────────────────────────────────────────────╢
  114. ║ v0.4.4 (15-Aug-2013)                                                         ║
  115. ║   ● Add: Version display on Title screen                                     ║
  116. ╟──────────────────────────────────────────────────────────────────────────────╢
  117. ║ v0.3.4 (10-Apr-2013)                                                         ║
  118. ║   ● Tweak: Moved Title/Game Over folders to Pictures for easier importation  ║
  119. ║   ● Tweak: Disable random title if Animated Title is enabled                 ║
  120. ╟──────────────────────────────────────────────────────────────────────────────╢
  121. ║ v0.3.2 (04-Mar-2013)                                                         ║
  122. ║   ● Add: Title & Author Logo speeds                                          ║
  123. ║   ● Bug Fix: Several inconcruities in Animation Title script                 ║
  124. ╟──────────────────────────────────────────────────────────────────────────────╢
  125. ║ v0.2.1 (03-Mar-2013)                                                         ║
  126. ║   ● Add: Author Logo to Animated Title script                                ║
  127. ╟──────────────────────────────────────────────────────────────────────────────╢
  128. ║ v0.1.1 (18-Dec-2013)                                                         ║
  129. ║   ● Tweak: Animated Title on/off for other animated title scripts            ║
  130. ║   ● Add: Full Animated Title script                                          ║
  131. ║                                                                              ║
  132. ╚══════════════════════════════════════════════════════════════════════════════╝
  133. =end
  134.  
  135. $imported = {} if $imported == nil; $imported["CW-QESATA"] = true
  136.  
  137. #===============================================================================
  138. # ** Q-Engine Animated Title Add-On Settings **
  139. #===============================================================================
  140. module QESATA_SETTINGS
  141.   #=============================================================================
  142.   # * ANIMATED TITLE OPTIONS *
  143.   #     These  options  are to  change the  settings for  the Animated
  144.   #     Title add-on.
  145.   #----------------------------------------------------------------------------
  146.   TOGGLE_ATA_ADDON = true             # Enable/disable QES Animated Title Add-On
  147.  
  148.   #----------------------------------------------------------------------------
  149.   # * Animated Title Screen
  150.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  151.   ANIMATED_TITLE = true               # Toggle animated title screen on/off
  152.     # Images for title animations. Place in "Graphics/Pictures/Titles/".
  153.     LAYER_IMAGES_TTL = [
  154.       "Q-Engine",                     # Logo or game title
  155.       "Author",                       # Author logo
  156.       "TitleMain",                    # Primary title background
  157.       "TitleMain",                    # First background layer for animation
  158.       "TitleMain",                    # Second background layer for animation
  159.       "TitleMain"                     # Third background layer for animation
  160.     ]
  161.     # Main Title/Logo
  162.     LOGO_START_COORDS = [105, -100]   # Logo starting coordinates
  163.     LOGO_END_COORDS = [105, 150]      # Logo ending coordinates
  164.     LOGO_SPEED = 2                    # Logo movement speed
  165.     # Author
  166.     AUTHOR_START_COORDS = [220, -100] # Author starting coordinates
  167.     AUTHOR_END_COORDS = [220, 199]    # Author ending coordinates
  168.     AUTHOR_SPEED = 3                  # Author movement speed
  169.     # Layers Effects/Movement
  170.     LAYER_OPACITIES = [120, 100, 110] # Opacities for animation layers
  171.     LAYER_BLENDS = [0, 1, 0]          # Animation layers blending modes
  172.     LAYER1_MOVE_COORDS = [2, 0]       # XY movement coordinates for first layer
  173.     LAYER2_MOVE_COORDS = [-2, 0]      # XY movement coordinates for second layer
  174.     LAYER3_MOVE_COORDS = [0, 0]       # XY movement coordinates for third layer
  175.   #=============================================================================
  176. end
  177.  
  178. #==============================================================================
  179. # ** DO NOT EDIT BEYOND THIS POINT **                                         #
  180. #==============================================================================
  181.  
  182. class QesAta
  183.   include QESATA_SETTINGS
  184.  
  185.   module Required
  186.   QESATA_VERSION = "4.0"
  187.   p("Q-Engine Animated Title Add-On - "+
  188.     "It appears that you have an older version of the Q-Engine script, which"+
  189.     " might not be compatible with this version of the Q-Engine Animated Title"+
  190.     " Add-On. If you receive any errors, please upgrade the Q-Engine"+
  191.     " to the latest version from the RPG Maker Times & Companion blogsite:"+
  192.     " http://blog.rpgmakertimes.info.") if $imported["CWQesVX"] && QEngine::QES_VERSION < QESATA_VERSION
  193.   #============================================================================
  194.   # ** REQUIRED MODULES SETTINGS **
  195.   #----------------------------------------------------------------------------
  196.   REQ_MODULES_QESATA = {
  197.       #----------------------------------------------------------------------------
  198.       #     Note: The "Universal Configuration Module" (UCSM) is no longer
  199.       #     required to run the Q-Engine, as most of the relevant settings
  200.       #     have now been integrated into the Q-Engines for better ease of
  201.       #     use.  The "Global Colors Module"  and the "Bitmap Addons"  ARE
  202.       #     required, so they need to be set to "Yes" or "True" to prevent
  203.       #     an error from occurring (the case does not matter).
  204.       #
  205.       #     You can add your own  required scripts  to the list,  but make
  206.       #     sure you follow the sequence precisely.
  207.       #
  208.       #     * "Module Name" - The name of the required script.
  209.       #     * "Import Name" - The $import hash  (like a unique identifying
  210.       #       name) for  the script.  If set to "false",  then the  entire
  211.       #       script  relating to the  $import is considered  as disabled.
  212.       #       When it's set to "true" or contains either a string or digit
  213.       #       (such as for a version number), it's considered as enabled.
  214.       #     * "Type" - The type of  script the requirement is:  "M" is for
  215.       #       "Module", "A" is for "Add-On" and "S" is for "Script".  This
  216.       #       will then be displayed in the resulting error message.
  217.       #     * "Required" - This determines whether  the script is required
  218.       #       in order for  the game to run properly.  Values can be "Yes"
  219.       #       or "No" and "True" or "False" (the case doesn't matter).  If
  220.       #       set to "Yes" or "True",  an error message will  occur giving
  221.       #       details of the missing or uninstalled script type.
  222.       #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  223.       #                                                            Required
  224.       #         Module Name         Import Name      Type     Yes/No/True/False
  225.       #---------------------------------------------------------------------------
  226.       0 => ["Global Colors",      "CWColors",       "M",    "Yes"], # Required
  227.       1 => ["Q-Engine",           "CWQesVX",        "S",    "Yes"], # Required
  228.       2 => ["Bitmap Addons",      "CWBitmapAddons", "A",    "Yes"],  # Required
  229.     }
  230.     #--------------------------------------------------------------------------
  231.     # * Check Required Modules
  232.     #     Displays the  current  project version  in the  top right-hand
  233.     #     This routine will check through  the requirements  (predefined
  234.     #     in REQ_MODULES_QESATA)  and  determine  if they  are required.
  235.     #     Non-required modules  will be  skipped,  but an  error message
  236.     #     dialog will  display  each one  either not  installed  or  not
  237.     #     turned on.
  238.     #--------------------------------------------------------------------------
  239.     module_mssg = " is disabled, missing or not properly implemented."
  240.     body_mssg = " Please ensure that it is enabled or installed correctly."
  241.     req_modules = REQ_MODULES_QESATA
  242.     for i in 0...req_modules.size
  243.       import = $imported[req_modules[i][1]] unless $imported == nil
  244.       case req_modules[i][2]
  245.       when "M"; type = " Module"; when "A"; type = " Add-On"; when "S"; type = " Script"
  246.       end
  247.       unless import || req_modules[i][3].downcase == "no" || req_modules[i][3].downcase == "false"
  248.         p ["QES Error: The required ", req_modules[i][0], type, module_mssg, body_mssg].join
  249.         ok = false; next
  250.       end
  251.     end
  252.     exit if ok == false
  253.   end
  254. end
  255.  
  256. #==============================================================================
  257. # ** Scene_Title (QES-ATA)
  258. #------------------------------------------------------------------------------
  259. # Aliased Methods
  260. #   * create_title_graphic
  261. #   * dispose_command_window
  262. #   * update
  263. #==============================================================================
  264.  
  265. class Scene_Title < Scene_Base
  266.   include QESATA_SETTINGS
  267.   #--------------------------------------------------------------------------
  268.   # * Create Title Graphic                                      |--ALIASED--|
  269.   #--------------------------------------------------------------------------
  270.   alias cwqeata_scnttl_create_title_graphic create_title_graphic
  271.   def create_title_graphic
  272.     cwqeata_scnttl_create_title_graphic
  273.     if TOGGLE_ATA_ADDON && ANIMATED_TITLE
  274.       @sprite.bitmap = Cache.title("") # Disable default
  275.       # Main Background
  276.       @sprite_title = Sprite.new
  277.       @sprite_title.bitmap = Cache.title(LAYER_IMAGES_TTL[2])
  278.       @sprite_title.opacity = 100
  279.       # Logo
  280.       @sprite_logo = Sprite.new
  281.       @sprite_logo.bitmap = Cache.title(LAYER_IMAGES_TTL[0])
  282.       @sprite_logo.x, @sprite_logo.y = LOGO_START_COORDS[0], LOGO_START_COORDS[1]
  283.       #Author
  284.       @sprite_author = Sprite.new
  285.       @sprite_author.bitmap = Cache.title(LAYER_IMAGES_TTL[1])
  286.       @sprite_author.x, @sprite_author.y = AUTHOR_START_COORDS[0], AUTHOR_START_COORDS[1]
  287.       # Layer 1
  288.       @sprite_bg1 = Plane.new
  289.       @sprite_bg1.bitmap = Cache.title(LAYER_IMAGES_TTL[3])
  290.       @sprite_bg1.opacity = LAYER_OPACITIES[0]
  291.       @sprite_bg1.blend_type = LAYER_BLENDS[0]
  292.       # Layer 2
  293.       @sprite_bg2 = Plane.new
  294.       @sprite_bg2.bitmap = Cache.title(LAYER_IMAGES_TTL[4])
  295.       @sprite_bg2.opacity = LAYER_OPACITIES[1]
  296.       @sprite_bg2.blend_type = LAYER_BLENDS[1]
  297.       # Layer 3
  298.       @sprite_bg3 = Plane.new
  299.       @sprite_bg3.bitmap = Cache.title(LAYER_IMAGES_TTL[5])
  300.       @sprite_bg3.opacity = LAYER_OPACITIES[2]
  301.       @sprite_bg3.blend_type = LAYER_BLENDS[2]
  302.       # Priorities
  303.       @sprite_title.z = 4
  304.       @sprite_logo.z = 5
  305.       @sprite_author.z = 5
  306.       @sprite_bg1.z = 1
  307.       @sprite_bg2.z = 2
  308.       @sprite_bg3.z = 3
  309.     end
  310.   end
  311.   #--------------------------------------------------------------------------
  312.   # * Dispose of Command Window                                 |--ALIASED--|
  313.   #--------------------------------------------------------------------------
  314.   alias cwqeata_scnttl_dispose dispose_command_window
  315.   def dispose_command_window
  316.     cwqeata_scnttl_dispose
  317.     if TOGGLE_ATA_ADDON && ANIMATED_TITLE
  318.       @sprite_title.dispose
  319.       @sprite_author.dispose
  320.       @sprite_logo.dispose
  321.       @sprite_bg1.dispose
  322.       @sprite_bg2.dispose
  323.       @sprite_bg3.dispose
  324.     end
  325.   end
  326.   #--------------------------------------------------------------------------
  327.   # * Frame Update                                              |--ALIASED--|
  328.   #--------------------------------------------------------------------------
  329.   alias cwqeata_scnttl_update update
  330.   def update
  331.     cwqeata_scnttl_update
  332.     if TOGGLE_ATA_ADDON && ANIMATED_TITLE
  333.       @sprite_title.opacity += 1 unless @sprite_title.opacity = 160
  334.       if @sprite_logo.x != LOGO_END_COORDS[0]
  335.         @sprite_logo.x += LOGO_SPEED
  336.       end
  337.       if @sprite_author.x != AUTHOR_END_COORDS[0]
  338.         @sprite_author.x += AUTHOR_SPEED
  339.       end
  340.       @sprite_logo.y += LOGO_SPEED unless @sprite_logo.y >= LOGO_END_COORDS[1]
  341.       @sprite_author.y += AUTHOR_SPEED unless @sprite_author.y >= AUTHOR_END_COORDS[1]
  342.       @sprite_bg1.ox += LAYER1_MOVE_COORDS[0]
  343.       @sprite_bg1.oy += LAYER1_MOVE_COORDS[1]
  344.       @sprite_bg2.ox += LAYER2_MOVE_COORDS[0]
  345.       @sprite_bg2.oy += LAYER2_MOVE_COORDS[1]
  346.       @sprite_bg3.ox += LAYER3_MOVE_COORDS[0]
  347.       @sprite_bg3.oy += LAYER3_MOVE_COORDS[1]
  348.     end
  349.   end
  350. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement