设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 133|回复: 0

[转载发布] Dynamic Title

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58883
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68848

    灌水之王

    发表于 2026-8-3 08:31:08 | 显示全部楼层 |阅读模式

    Dynamic Title 1.1
            by Racheal





    Introduction
            This script changes the title screen based on a variable set in-game. This could be used, for example, to add a character to the title screen after you meet them.

    Features


    • Change the background, foreground, or both.
    • Pull the variable from the latest save or the highest from all the saves.
    • Use numbers corresponding to the variable for your images or set the names of the files you would like to use

    How to Use
            Insert the script anywhere in the Materials section above Main.

    Script

    Spoiler                Code:       
    1. #==============================================================================
    2. # Dynamic Title
    3. # by: Racheal
    4. # Version 1.1
    5. # Created: 24/06/2013
    6. # Updated: 27/09/2013
    7. #==============================================================================
    8. # Changes the title screen based on a variable set in-game.
    9. #==============================================================================
    10. # Instructions:
    11. # * Insert in the Materials section
    12. # * Configure to your liking below
    13. #==============================================================================
    14. # Compatibility:
    15. # This script is for RPG Maker VX Ace
    16. # It is unlikely to work with anything that modifies the way the
    17. # title screen is drawn such as an animated title screen
    18. # * Overwrites: Scene_Title: create_background
    19. #==============================================================================
    20. #==============================================================================
    21. # Customization
    22. #==============================================================================
    23. module Racheal_Title
    24.   #Set which variable controls the change in the title screen
    25.   TITLE_VARIABLE = 5
    26.   
    27.   #Set which parts of the title screen are affected
    28.   CHANGE_BACKGROUND = true
    29.   CHANGE_FOREGROUND = true
    30.   
    31.   #Set whether to check the highest variable in all the save files or
    32.   #just use the most recent save
    33.   CHECK_ALL_SAVES = false
    34.   
    35.   #Set whether to use a series of numbers for the filenames (0.png, 1.png, etc)
    36.   #or a series of names you define below
    37.   USE_FILENAMES = true
    38.   BACKGROUND_NAMES = ["Volcano", "Night"]
    39.   FOREGROUND_NAMES = ["Gargoyles", ""]
    40. end
    41. #==============================================================================
    42. # End Customization
    43. #==============================================================================
    44. #==============================================================================
    45. # ** DataManager
    46. #==============================================================================
    47. module DataManager
    48.   #--------------------------------------------------------------------------
    49.   # * Create Save Header
    50.   #--------------------------------------------------------------------------
    51.   class << self; alias dynamic_title_make_save_header make_save_header; end
    52.   def self.make_save_header
    53.       header = dynamic_title_make_save_header
    54.       header[:title] = $game_variables[Racheal_Title::TITLE_VARIABLE]
    55.       header
    56.   end
    57. end
    58. #==============================================================================
    59. # ** Scene_Title
    60. #==============================================================================
    61. class Scene_Title < Scene_Base
    62.   #--------------------------------------------------------------------------
    63.   # * Create Background
    64.   #--------------------------------------------------------------------------
    65.   def create_background
    66.     @sprite1 = Sprite.new
    67.     sprite_name = Racheal_Title::CHANGE_BACKGROUND ? get_title(1) : $data_system.title1_name
    68.     @sprite1.bitmap = Cache.title1(sprite_name)
    69.     @sprite2 = Sprite.new
    70.     sprite_name = Racheal_Title::CHANGE_FOREGROUND ? get_title(2) : $data_system.title2_name
    71.     @sprite2.bitmap = Cache.title2(sprite_name)
    72.     center_sprite(@sprite1)
    73.     center_sprite(@sprite2)
    74.   end
    75.   #--------------------------------------------------------------------------
    76.   # * Get Title Sprite Name
    77.   #--------------------------------------------------------------------------
    78.   def get_title(num)
    79.     title = 0
    80.     if Racheal_Title::CHECK_ALL_SAVES
    81.       #Check all saves
    82.       for i in 0...DataManager.savefile_max
    83.         header = DataManager.load_header(i)
    84.         next unless header and header[:title]
    85.         title = [title, header[:title]].max
    86.       end
    87.     else
    88.       #Check latest save
    89.       header = DataManager.load_header(DataManager.latest_savefile_index)
    90.       if header and header[:title]
    91.         title = [title, header[:title]].max
    92.       end
    93.     end
    94.     #---
    95.     if Racheal_Title::USE_FILENAMES
    96.       #convert number to name
    97.       case num
    98.       when 1
    99.         return Racheal_Title::BACKGROUND_NAMES[title]
    100.       when 2
    101.         return Racheal_Title::FOREGROUND_NAMES[title]
    102.       end
    103.     else
    104.       return title.to_s
    105.     end
    106.   end
    107. end
    复制代码







    Credit
            - Racheal

    Author's Notes
            Free for commercial and non-commercial use. Just credit me (and let me know if you use it, just because). There's really not too much to this script. Version 1.1 features increased compatibility with save systems thanks to estriole's tip.

            As this is a script that modifies the save header, it will not work with saves created before this script was installed.


    本贴来自国际rpgmaker官方论坛作者:Yato处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/dynamic-title.14549/
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-17 07:17 , Processed in 0.136730 second(s), 54 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表