搜索附件  

动态标题(新).zip

 

仿 XAS 3.82 的动态式标题:
时隔六年的更新……

各功能测试通过。

RUBY 代码
  1. =begin
  2. ================================================================================
  3. 滚动图片式标题
  4. ________________________________________________________________________________
  5. 【版本历史】
  6. 版本      日期            备注
  7. -----     -----------     ----------------------------------------------------
  8. 2.0   ... 2018.10.07 ...  脚本结构优化;代码规范化;增加范例工程
  9. 1.0   ... 2012.10.07 ...  最初版本
  10. ________________________________________________________________________________
  11. 【简介】
  12. 仿照 XAS 3.82 的标题画面,在标题中加入全景图及雾图形,增强视觉效果。
  13. ________________________________________________________________________________
  14. 【使用方式】
  15. 替换默认的 Scene_Title,或插入到 Main 之前。
  16. ________________________________________________________________________________
  17. 【作者】
  18. 失落的乐章
  19. ================================================================================
  20. =end
  21. module SGSTITLE
  22.   # 固定标题图的路径(若为 nil 则采用数据库中设置的标题画面图形)
  23.   TITLE = nil
  24.   # 固定标题图显示方式(0:在滚动背景图与雾图形之下;
  25.   # 1:在背景图之上,雾图形之下;2:在滚动背景图与雾图形之上)
  26.   TYPE = 1
  27.   # 固定标题图的原点
  28.   TITLE_OX = 0
  29.   TITLE_OY = 0
  30.   # 固定标题图的坐标
  31.   TITLE_X = 50
  32.   TITLE_Y = 111
  33.   # 滚动背景图的路径
  34.   PLANE = "Graphics/Panoramas/001-Sky01.jpg"
  35.   # 滚动背景图不透明度
  36.   PLANE_OPACITY = 120
  37.   # 背景图滚动速度
  38.   PLANE_OX = 1
  39.   PLANE_OY = 1
  40.   # 雾图形的路径
  41.   FOG = "Graphics/Fogs/001-Fog01.png"
  42.   # 雾图形不透明度
  43.   FOG_OPACITY = 50
  44.   # 雾图形合成方式(0:正常;1:加法;2:减法)
  45.   FOG_BLEND_TYPE = 1
  46.   # 雾图形滚动速度
  47.   FOG_OX = -1
  48.   FOG_OY =  1
  49. end
  50. class Scene_Title
  51.   include SGSTITLE
  52.    def main
  53.     if$BTEST
  54.       battle_test
  55.       return
  56.     end
  57.     $data_actors        = load_data("Data/Actors.rxdata")
  58.     $data_classes       = load_data("Data/Classes.rxdata")
  59.     $data_skills        = load_data("Data/Skills.rxdata")
  60.     $data_items         = load_data("Data/Items.rxdata")
  61.     $data_weapons       = load_data("Data/Weapons.rxdata")
  62.     $data_armors        = load_data("Data/Armors.rxdata")
  63.     $data_enemies       = load_data("Data/Enemies.rxdata")
  64.     $data_troops        = load_data("Data/Troops.rxdata")
  65.     $data_states        = load_data("Data/States.rxdata")
  66.     $data_animations    = load_data("Data/Animations.rxdata")
  67.     $data_tilesets      = load_data("Data/Tilesets.rxdata")
  68.     $data_common_events = load_data("Data/CommonEvents.rxdata")
  69.     $data_system        = load_data("Data/System.rxdata")
  70.     $game_system = Game_System.new
  71.     s1 = "新游戏"
  72.     s2 = "继续"
  73.     s3 = "退出"
  74.     @command_window = Window_Command.new(192, [s1, s2, s3])
  75.     @command_window.back_opacity = 160
  76.     @command_window.x = 320 - @command_window.width / 2
  77.     @command_window.y = 288
  78.     @continue_enabled = false
  79.     @plane = Plane.new
  80.     @plane.bitmap = Bitmap.new(PLANE)
  81.     @plane.z = 2
  82.     @fog = Plane.new
  83.     @fog.bitmap = Bitmap.new(FOG)
  84.     @fog.opacity = FOG_OPACITY
  85.     @fog.blend_type = FOG_BLEND_TYPE
  86.     @fog.z = 4
  87.     @title = Sprite.new
  88.     @title.bitmap = TITLE ? Bitmap.new(TITLE) : RPG::Cache.title($data_system.title_name)
  89.     @title.ox = TITLE_OX
  90.     @title.oy = TITLE_OY
  91.     @title.x = TITLE_X
  92.     @title.y = TITLE_Y
  93.     @title.z = case TYPE
  94.                when0then1
  95.                when1then3
  96.                when2then5
  97.                else5
  98.                end
  99.     for i in0..3
  100.       ifFileTest.exist?("Save#{i+1}.rxdata")
  101.         @continue_enabled = true
  102.       end
  103.     end
  104.     if@continue_enabled
  105.       @command_window.index = 1
  106.     else
  107.       @command_window.disable_item(1)
  108.     end
  109.     $game_system.bgm_play($data_system.title_bgm)
  110.     Audio.me_stop
  111.     Audio.bgs_stop
  112.     Graphics.transition
  113.     loopdo
  114.       Graphics.update
  115.       Input.update
  116.       update
  117.       if$scene != self
  118.         break
  119.       end
  120.     end
  121.     Graphics.freeze
  122.     @command_window.dispose
  123.     @plane.bitmap.dispose
  124.     @plane.dispose
  125.     @fog.bitmap.dispose   
  126.     @fog.dispose
  127.     @title.bitmap.dispose
  128.     @title.dispose   
  129.   end
  130.   def update
  131.     @plane.ox += PLANE_OX
  132.     @plane.oy += PLANE_OY
  133.     @fog.ox += FOG_OX
  134.     @fog.oy += FOG_OY
  135.     @command_window.update
  136.     if Input.trigger?(Input::C)
  137.       case@command_window.index
  138.       when0
  139.         command_new_game
  140.       when1
  141.         command_continue
  142.       when2
  143.         command_shutdown
  144.       end
  145.     end
  146.   end
  147.   def command_new_game
  148.     $game_system.se_play($data_system.decision_se)
  149.     Audio.bgm_stop
  150.     Graphics.frame_count = 0
  151.     $game_temp          = Game_Temp.new
  152.     $game_system        = Game_System.new
  153.     $game_switches      = Game_Switches.new
  154.     $game_variables     = Game_Variables.new
  155.     $game_self_switches = Game_SelfSwitches.new
  156.     $game_screen        = Game_Screen.new
  157.     $game_actors        = Game_Actors.new
  158.     $game_party         = Game_Party.new
  159.     $game_troop         = Game_Troop.new
  160.     $game_map           = Game_Map.new
  161.     $game_player        = Game_Player.new
  162.     $game_party.setup_starting_members
  163.     $game_map.setup($data_system.start_map_id)
  164.     $game_player.moveto($data_system.start_x, $data_system.start_y)
  165.     $game_player.refresh
  166.     $game_map.autoplay
  167.     $game_map.update
  168.     $scene = Scene_Map.new
  169.   end
  170.   def command_continue
  171.     unless@continue_enabled
  172.       $game_system.se_play($data_system.buzzer_se)
  173.       return
  174.     end
  175.     $game_system.se_play($data_system.decision_se)
  176.     $scene = Scene_Load.new
  177.   end
  178.   def command_shutdown
  179.     $game_system.se_play($data_system.decision_se)
  180.     Audio.bgm_fade(800)
  181.     Audio.bgs_fade(800)
  182.     Audio.me_fade(800)
  183.     $scene = nil
  184.   end
  185.   def battle_test
  186.     $data_actors        = load_data("Data/BT_Actors.rxdata")
  187.     $data_classes       = load_data("Data/BT_Classes.rxdata")
  188.     $data_skills        = load_data("Data/BT_Skills.rxdata")
  189.     $data_items         = load_data("Data/BT_Items.rxdata")
  190.     $data_weapons       = load_data("Data/BT_Weapons.rxdata")
  191.     $data_armors        = load_data("Data/BT_Armors.rxdata")
  192.     $data_enemies       = load_data("Data/BT_Enemies.rxdata")
  193.     $data_troops        = load_data("Data/BT_Troops.rxdata")
  194.     $data_states        = load_data("Data/BT_States.rxdata")
  195.     $data_animations    = load_data("Data/BT_Animations.rxdata")
  196.     $data_tilesets      = load_data("Data/BT_Tilesets.rxdata")
  197.     $data_common_events = load_data("Data/BT_CommonEvents.rxdata")
  198.     $data_system        = load_data("Data/BT_System.rxdata")
  199.     Graphics.frame_count = 0
  200.     $game_temp          = Game_Temp.new
  201.     $game_system        = Game_System.new
  202.     $game_switches      = Game_Switches.new
  203.     $game_variables     = Game_Variables.new
  204.     $game_self_switches = Game_SelfSwitches.new
  205.     $game_screen        = Game_Screen.new
  206.     $game_actors        = Game_Actors.new
  207.     $game_party         = Game_Party.new
  208.     $game_troop         = Game_Troop.new
  209.     $game_map           = Game_Map.new
  210.     $game_player        = Game_Player.new
  211.     $game_party.setup_battle_test_members
  212.     $game_temp.battle_troop_id = $data_system.test_troop_id
  213.     $game_temp.battle_can_escape = true
  214.     $game_map.battleback_name = $data_system.battleback_name
  215.     $game_system.se_play($data_system.battle_start_se)
  216.     $game_system.bgm_play($game_system.battle_bgm)
  217.     $scene = Scene_Battle.new
  218.   end
  219. end
复制代码


范例工程:

             本帖来自P1论坛作者失落的乐章,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=251047  若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。

QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

GMT+8, 2024-11-11 05:22 , Processed in 0.037717 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

返回顶部