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

[转载发布] Random Title Screen v1.0

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

    连续签到: 2 天

    [LV.7]常住居民III

    7959

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 3 天前 | 显示全部楼层 |阅读模式
    Introduction
    Allows for customising and randomising various aspects of the Title Screen

    Features

    • Randomise the title, as well as its y position, font size, outline width, colours, and font*
    • Can include an optional subtitle that may be similarly randomised
    • Randomise title1 and title2 images, as well as their hue
    • Allows for drawing another title2 image on the foreground layer
    • Randomise the title BGM, as well as its pitch
    • Can include an optional BGS to play alongside the BGM which may also be similarly randomised
    *font changes may require additional plugins

    How to use
    Adjust the parameters as you see fit.
    Most of them should be pretty self-explanatory, but there are a few new features added by this plugin.

    Subtitle
    Allows for an optional subtitle to be placed beneath your title.
    To use this, you must have "Draw Game Title" enabled.
    The subtitle may either copy the title's colours, or draw from its own pool.

    Hue min/max
    Allows for setting a minimum and maximum hue adjustment that will be applied at random to the title1/title2 image.

    Titles2 (Foreground)
    By default, MV draws titles1 and titles2 images on the background layer.
    This allows you to draw another image from titles2 on the foreground layer, in addition to the default background titles2 image.

    Title BGS
    Allows you to include an optional BGS to play alongside the title BGM.

    Pitch min/max
    Allows for setting a minimum and maximum pitch that will be applied at random to the BGM/BGS

    Reroll Frequency
    This allows you to determine how often the images or BGM/BGS will be rerolled.
    Once only - Roll once, upon booting up the game.
    (restarting the game via F5 also counts as booting up the game)
    After game - Reroll after entering and exiting a playthrough
    (i.e. game over / game end / return to title)
    Always - Reroll every time the title screen is entered
    (i.e. after adjusting options from the title screen, or if you have custom scenes accessible from the title)

    Script
    Spoiler: CODE
                    JavaScript:       
    1. //==========================================
    2. // APHO_RandomTitleScreen.js
    3. //==========================================
    4. /*:
    5. * @title Random Title Screen
    6. * @author Apho
    7. * @plugindesc v1.0 Allows for customising and randomising various aspects of the Title Screen
    8. *
    9. * @param UseTitle
    10. * @text Use Title?
    11. * @type boolean
    12. * @desc Use the title features provided by this plugin?
    13. * @default true
    14. *
    15. * @param TitleList
    16. * @parent UseTitle
    17. * @text Title List
    18. * @type string[]
    19. * @desc Pool of strings that will be used for the title.
    20. *
    21. * @param TitleY
    22. * @parent UseTitle
    23. * @text Title y position
    24. * @type string
    25. * @desc Y position of the title. This is an eval.
    26. (Default: Graphics.height / 4)
    27. * @default Graphics.height / (3.5 + Math.random())
    28. *
    29. * @param TitleFontSize
    30. * @parent UseTitle
    31. * @text Title Font Size
    32. * @type string
    33. * @desc Font size of the title. This is an eval. (Default: 72)
    34. * @default 67 + Math.randomInt(11)
    35. *
    36. * @param TitleFontOutlineWidth
    37. * @parent UseTitle
    38. * @text Title Font Outline Width
    39. * @type string
    40. * @desc Outline width of the title. This is an eval. (Default: 8)
    41. * @default 7 + Math.randomInt(3)
    42. *
    43. * @param TitleFontColourList
    44. * @parent UseTitle
    45. * @text Title Font Colour List
    46. * @type string[]
    47. * @require 1
    48. * @desc Pool of colours that will be used for the title.
    49. * @default ["#FFFFFF", "#FFF0F5", "#F0FFF0", "#F0FFFF"]
    50. *
    51. * @param TitleOutlineColourList
    52. * @parent UseTitle
    53. * @text Title Outline Colour List
    54. * @type string[]
    55. * @require 1
    56. * @desc Pool of colours that will be used for the title's outline.
    57. * @default ["'black'", "#36454F"]
    58. *
    59. * @param TitleFontList
    60. * @parent UseTitle
    61. * @text Title Font List
    62. * @type string[]
    63. * @require 1
    64. * @desc Pool of fonts that will be used for the title. This will require another plugin to preload fonts other than GameFont.
    65. * @default ["GameFont"]
    66. *
    67. * @param UseSubtitle
    68. * @text Use Subtitle?
    69. * @type boolean
    70. * @desc Add a subtitle below your title?
    71. * @default false
    72. *
    73. * @param SubtitleList
    74. * @parent UseSubtitle
    75. * @text Subtitle List
    76. * @type string[]
    77. * @desc Pool of strings that will be used for the subtitle.
    78. *
    79. * @param SubtitleSpacing
    80. * @parent UseSubtitle
    81. * @text Title-subtitle spacing
    82. * @type string
    83. * @desc The spacing between the subtitle and title.
    84. * @default -5 - Math.randomInt(5)
    85. *
    86. * @param SubtitleFontSize
    87. * @parent UseSubtitle
    88. * @text Subtitle Font Size
    89. * @type string
    90. * @desc Font size of the subtitle. This is an eval. For title size, use this._gameTitleSprite.bitmap.fontSize
    91. * @default Math.round(this._gameTitleSprite.bitmap.fontSize * (0.45 + Math.random() * 0.1))
    92. *
    93. * @param SubtitleFontOutlineWidth
    94. * @parent UseSubtitle
    95. * @text Subtitle Font Outline Width
    96. * @type string
    97. * @desc Outline width of the subtitle. This is an eval. For title outline width, use this._gameTitleSprite.bitmap.outlineWidth
    98. * @default 4 + Math.randomInt(3)
    99. *
    100. * @param UseTitleFontColour
    101. * @parent UseSubtitle
    102. * @text Use Title's Font Colour?
    103. * @type boolean
    104. * @desc Use the same font colour as the title? Otherwise, draw from below pool.
    105. * @default false
    106. *
    107. * @param SubtitleFontColourList
    108. * @parent UseSubtitle
    109. * @text Subtitle Font Colour List
    110. * @type string[]
    111. * @require 1
    112. * @desc Pool of colours that will be used for the subtitle.
    113. * @default ["#FFFFFF", "#FFF0F5", "#F0FFF0", "#F0FFFF"]
    114. *
    115. * @param UseTitleOutlineColour
    116. * @parent UseSubtitle
    117. * @text Use Title's Outline Colour?
    118. * @type boolean
    119. * @desc Use the same outline colour as the title? Otherwise, draw from below pool.
    120. * @default false
    121. *
    122. * @param SubtitleOutlineColourList
    123. * @parent UseSubtitle
    124. * @text Subtitle Outline Colour List
    125. * @type string[]
    126. * @require 1
    127. * @desc Pool of colours that will be used for the subtitle's outline.
    128. * @default ["'black'", "#36454F"]
    129. *
    130. * @param UseTitleFont
    131. * @parent UseSubtitle
    132. * @text Use Title's Font?
    133. * @type boolean
    134. * @desc Use the same font as the title? Otherwise, draw from below pool.
    135. * @default false
    136. *
    137. * @param SubtitleFontList
    138. * @parent UseSubtitle
    139. * @text Subtitle Font List
    140. * @type string[]
    141. * @require 1
    142. * @desc Pool of fonts that will be used for the subtitle. This will require another plugin to preload fonts other than GameFont.
    143. * @default ["GameFont"]
    144. *
    145. * @param BGTitles1List
    146. * @text Titles1 List (Background)
    147. * @type file[]
    148. * @dir img/titles1
    149. * @desc Pool of title1 images for the title screen. This will be drawn in the background.
    150. *
    151. * @param BGTitles1HueMin
    152. * @parent BGTitles1List
    153. * @text Minimum hue
    154. * @type number
    155. * @desc Minimum hue adjustment for the title1 background image.
    156. * @min -360
    157. * @default -15
    158. *
    159. * @param BGTitles1HueMax
    160. * @parent BGTitles1List
    161. * @text Maximum hue
    162. * @type number
    163. * @desc Maximum hue adjustment for the title1 background image.
    164. * @min -360
    165. * @default 15
    166. *
    167. * @param BGTitles1RerollFreq
    168. * @parent BGTitles1List
    169. * @text Reroll Frequency
    170. * @type select
    171. * @option Once only
    172. * @value 0
    173. * @option After game
    174. * @value 1
    175. * @option Always
    176. * @value 2
    177. * @desc How often should titles1 (background) be rerolled?
    178. * @default 2
    179. *
    180. * @param BGTitles2List
    181. * @text Titles2 List (Background)
    182. * @type file[]
    183. * @dir img/titles2
    184. * @desc Pool of title2 images for the title screen. This will be drawn in the background.
    185. *
    186. * @param BGTitles2HueMin
    187. * @parent BGTitles2List
    188. * @text Minimum hue
    189. * @type number
    190. * @desc Minimum hue adjustment for the title2 image.
    191. * @min -360
    192. * @default -180
    193. *
    194. * @param BGTitles2HueMax
    195. * @parent BGTitles2List
    196. * @text Maximum hue
    197. * @type number
    198. * @desc Maximum hue adjustment for the title2 image.
    199. * @min -360
    200. * @default 180
    201. *
    202. * @param BGTitles2RerollFreq
    203. * @parent BGTitles2List
    204. * @text Reroll Frequency
    205. * @type select
    206. * @option Once only
    207. * @value 0
    208. * @option After game
    209. * @value 1
    210. * @option Always
    211. * @value 2
    212. * @desc How often should titles2 (background) be rerolled?
    213. * @default 2
    214. *
    215. * @param FGTitles2List
    216. * @text Titles2 List (Foreground)
    217. * @type file[]
    218. * @dir img/titles2
    219. * @desc Pool of title2 images for the title screen. This will be drawn in the foreground.
    220. *
    221. * @param FGTitles2HueMin
    222. * @parent FGTitles2List
    223. * @text Minimum hue
    224. * @type number
    225. * @desc Minimum hue adjustment for the title2 image.
    226. * @min -360
    227. * @default -180
    228. *
    229. * @param FGTitles2HueMax
    230. * @parent FGTitles2List
    231. * @text Maximum hue
    232. * @type number
    233. * @desc Maximum hue adjustment for the title2 image.
    234. * @min -360
    235. * @default 180
    236. *
    237. * @param FGTitles2RerollFreq
    238. * @parent FGTitles2List
    239. * @text Reroll Frequency
    240. * @type select
    241. * @option Once only
    242. * @value 0
    243. * @option After game
    244. * @value 1
    245. * @option Always
    246. * @value 2
    247. * @desc How often should titles2 (foreground) be rerolled?
    248. * @default 2
    249. *
    250. * @param TitleBGMList
    251. * @text Title BGM List
    252. * @type file[]
    253. * @dir audio/bgm
    254. * @desc Pool of BGMs for the title screen.
    255. *
    256. * @param TitleBGMVolume
    257. * @parent TitleBGMList
    258. * @text Volume
    259. * @type number
    260. * @desc Volume of the title BGM.
    261. * @default 90
    262. *
    263. * @param TitleBGMPitchMin
    264. * @parent TitleBGMList
    265. * @text Minimum pitch
    266. * @type number
    267. * @desc Minimum pitch of the title BGM.
    268. * @default 100
    269. *
    270. * @param TitleBGMPitchMax
    271. * @parent TitleBGMList
    272. * @text Maximum pitch
    273. * @type number
    274. * @desc Maximum pitch of the title BGM.
    275. * @default 110
    276. *
    277. * @param TitleBGMRerollFreq
    278. * @parent TitleBGMList
    279. * @text Reroll Frequency
    280. * @type select
    281. * @option Once only
    282. * @value 0
    283. * @option After game
    284. * @value 1
    285. * @option Always
    286. * @value 2
    287. * @desc How often should the BGM be rerolled?
    288. * @default 1
    289. *
    290. * @param TitleBGSList
    291. * @text Title BGS List
    292. * @type file[]
    293. * @dir audio/bgs
    294. * @desc Pool of BGSs for the title screen.
    295. *
    296. * @param TitleBGSVolume
    297. * @parent TitleBGSList
    298. * @text Volume
    299. * @type number
    300. * @desc Volume of the title BGS.
    301. * @default 30
    302. *
    303. * @param TitleBGSPitchMin
    304. * @parent TitleBGSList
    305. * @text Minimum pitch
    306. * @type number
    307. * @desc Minimum pitch of the title BGS.
    308. * @default 100
    309. *
    310. * @param TitleBGSPitchMax
    311. * @parent TitleBGSList
    312. * @text Maximum pitch
    313. * @type number
    314. * @desc Maximum pitch of the title BGS.
    315. * @default 110
    316. *
    317. * @param TitleBGSRerollFreq
    318. * @parent TitleBGSList
    319. * @text Reroll Frequency
    320. * @type select
    321. * @option Once only
    322. * @value 0
    323. * @option After game
    324. * @value 1
    325. * @option Always
    326. * @value 2
    327. * @desc How often should the BGS be rerolled?
    328. * @default 2
    329. *
    330. * @help
    331. * Adjust the parameters as you see fit.
    332. * Most of them should be pretty self-explanatory, but there are a few new
    333. * features added by this plugin.
    334. *
    335. * Subtitle
    336. * Allows for an optional subtitle to be placed beneath your title.
    337. * To use this, you must have "Draw Game Title" enabled.
    338. * The subtitle may either copy the title's colours, or draw from its own pool.
    339. *
    340. * Hue min/max
    341. * Allows for setting a minimum and maximum hue adjustment that will be applied
    342. * at random to the title1/title2 image.
    343. *
    344. * Titles2 (Foreground)
    345. * By default, MV draws titles1 and titles2 images on the background layer.
    346. * This allows you to draw another image from titles2 on the foreground layer, in
    347. * addition to the default background titles2 image.
    348. *
    349. * Title BGS
    350. * Allows you to include an optional BGS to play alongside the title BGM.
    351. *
    352. * Pitch min/max
    353. * Allows for setting a minimum and maximum pitch that will be applied at random
    354. * to the BGM/BGS
    355. *
    356. * Reroll Frequency
    357. * This allows you to determine how often the images or BGM/BGS will be rerolled.
    358. * Once only - Roll once, upon booting up the game.
    359. * (restarting the game via F5 also counts as booting up the game)
    360. * After game - Reroll after entering and exiting a playthrough
    361. * (i.e. game over / game end / return to title)
    362. * Always - Reroll every time the title screen is entered
    363. * (i.e. after adjusting options from the title screen, or if you have custom
    364. * scenes accessible from the title)
    365. *
    366. * TERMS OF USE
    367. * - Free for commercial and non-commercial use, as long as I get a free copy
    368. *   of the game.
    369. * - Edits allowed for personal use.
    370. * - Do not repost or claim as your own, even if edited.
    371. *
    372. * VERSION HISTORY
    373. * v1.0 - 2023/7/8 - Initial release.
    374. */
    375. (function(){
    376.     var parameters = PluginManager.parameters('APHO_RandomTitleScreen');
    377.     var TitleOutlineColourList = JSON.parse(parameters['TitleOutlineColourList']);
    378.     var TitleFontColourList = JSON.parse(parameters['TitleFontColourList']);
    379.     var TitleFontList = JSON.parse(parameters['TitleFontList']);
    380.     var UseTitle = JSON.parse(parameters['UseTitle']);
    381.     if(UseTitle)
    382.     {
    383.         if(parameters['TitleList'] != '' && parameters['TitleList'] != '[]')var TitleList = JSON.parse(parameters['TitleList']);
    384.     }
    385.     var UseSubtitle = JSON.parse(parameters['UseSubtitle']);
    386.     if(UseSubtitle)
    387.     {
    388.         var UseTitleFontColour = JSON.parse(parameters['UseTitleFontColour']);
    389.         if(!UseTitleFontColour)var SubtitleFontColourList = JSON.parse(parameters['SubtitleFontColourList']);
    390.         var UseTitleOutlineColour = JSON.parse(parameters['UseTitleOutlineColour']);
    391.         if(!UseTitleOutlineColour)var SubtitleOutlineColourList = JSON.parse(parameters['SubtitleOutlineColourList']);
    392.         var UseTitleFont = JSON.parse(parameters['UseTitleFont']);
    393.         if(!UseTitleFont)var SubtitleFontList = JSON.parse(parameters['SubtitleFontList']);
    394.         var SubtitleList = JSON.parse(parameters['SubtitleList']);
    395.     }
    396.     if(UseTitle || UseSubtitle)
    397.     {
    398.         Scene_Title.prototype.drawGameTitle = function() {
    399.             var x = 20;
    400.             var maxWidth = Graphics.width - x * 2;
    401.             if(UseTitle)
    402.             {
    403.                 var y = Function("return " + parameters['TitleY'])();
    404.                 var text = TitleList ? TitleList[Math.randomInt(TitleList.length)] : $dataSystem.gameTitle;
    405.                 this._gameTitleSprite.bitmap.textColor = TitleFontColourList[Math.randomInt(TitleFontColourList.length)];
    406.                 this._gameTitleSprite.bitmap.outlineColor = TitleOutlineColourList[Math.randomInt(TitleOutlineColourList.length)];
    407.                 this._gameTitleSprite.bitmap.outlineWidth = eval(parameters['TitleFontOutlineWidth']);
    408.                 this._gameTitleSprite.bitmap.fontSize = eval(parameters['TitleFontSize']);
    409.                 this._gameTitleSprite.bitmap.fontFace = TitleFontList[Math.randomInt(TitleFontList.length)];
    410.             }else
    411.             {
    412.                 var y = Graphics.height / 4;
    413.                 var text = $dataSystem.gameTitle;
    414.                 this._gameTitleSprite.bitmap.outlineColor = 'black';
    415.                 this._gameTitleSprite.bitmap.outlineWidth = 8;
    416.                 this._gameTitleSprite.bitmap.fontSize = 72;
    417.                 this._gameTitleSprite.bitmap.drawText(text, x, y, maxWidth, 48, 'center');
    418.             }
    419.             this._gameTitleSprite.bitmap.drawText(text, x, y, maxWidth, 48, 'center');
    420.             if(UseSubtitle)
    421.             {
    422.                 this._Subtitle = new Sprite(new Bitmap(Graphics.width, Graphics.height))
    423.                 this.addChild(this._Subtitle);
    424.                 this._Subtitle.bitmap.fontSize = eval(parameters['SubtitleFontSize']);
    425.                 this._Subtitle.bitmap.outlineWidth = eval(parameters['SubtitleFontOutlineWidth']);
    426.                 this._Subtitle.bitmap.textColor = UseTitleFontColour ? this._gameTitleSprite.bitmap.textColor : SubtitleFontColourList[Math.randomInt(SubtitleFontColourList.length)];
    427.                 this._Subtitle.bitmap.outlineColor = UseTitleOutlineColour ? this._gameTitleSprite.bitmap.outlineColor : SubtitleOutlineColourList[Math.randomInt(SubtitleOutlineColourList.length)];
    428.                 this._Subtitle.bitmap.fontFace = UseTitleFont ? this._gameTitleSprite.bitmap.fontFace : SubtitleFontList[Math.randomInt(SubtitleFontList.length)];
    429.                 let SubtitleY = y + this._gameTitleSprite.bitmap.fontSize + Function("return " + parameters['SubtitleSpacing'])();
    430.                 this._Subtitle.bitmap.drawText(SubtitleList[Math.randomInt(SubtitleList.length)], x, SubtitleY, maxWidth, 48,'center');
    431.             }
    432.         };
    433.     }
    434.     if(parameters['BGTitles1List'] != '' && parameters['BGTitles1List'] != '[]')
    435.     {
    436.         var BGTitles1List = JSON.parse(parameters['BGTitles1List']);
    437.         var BGTitles1HueRange = Math.max(parseInt(parameters['BGTitles1HueMax']) - parseInt(parameters['BGTitles1HueMin']), 0);
    438.         var BGTitles1Hue, BGTitles1;
    439.         function RerollBGTitles1(){
    440.             BGTitles1Hue = parseInt(parameters['BGTitles1HueMin']) + Math.randomInt(BGTitles1HueRange + 1);
    441.             BGTitles1 = BGTitles1List[Math.randomInt(BGTitles1List.length)];
    442.         }
    443.         RerollBGTitles1();
    444.         var BGTitles1RerollFreq = parseInt(parameters['BGTitles1RerollFreq']);
    445.         if(BGTitles1RerollFreq == 1)
    446.         {
    447.             const GameEnd_commandToTitle = Scene_GameEnd.prototype.commandToTitle;
    448.             Scene_GameEnd.prototype.commandToTitle = function(){
    449.                 RerollBGTitles1();
    450.                 GameEnd_commandToTitle.call(this);
    451.             }
    452.             const Scene_Gameover_gotoTitle = Scene_Gameover.prototype.gotoTitle;
    453.             Scene_Gameover.prototype.gotoTitle = function(){
    454.                 RerollBGTitles1();
    455.                 Scene_Gameover_gotoTitle.call(this);
    456.             }
    457.             const Game_Interpreter_command354 = Game_Interpreter.prototype.command354;
    458.             Game_Interpreter.prototype.command354 = function(){
    459.                 RerollBGTitles1();
    460.                 Game_Interpreter_command354.call(this);
    461.             }
    462.         }
    463.     }
    464.     if(parameters['BGTitles2List'] != '' && parameters['BGTitles2List'] != '[]')
    465.     {
    466.         var BGTitles2List = JSON.parse(parameters['BGTitles2List']);
    467.         var BGTitles2HueRange = Math.max(parseInt(parameters['BGTitles2HueMax']) - parseInt(parameters['BGTitles2HueMin']), 0);
    468.         var BGTitles2Hue, BGTitles2;
    469.         function RerollBGTitles2(){
    470.             BGTitles2Hue = parseInt(parameters['BGTitles2HueMin']) + Math.randomInt(BGTitles2HueRange + 1);
    471.             BGTitles2 = BGTitles2List[Math.randomInt(BGTitles2List.length)];
    472.         }
    473.         RerollBGTitles2();
    474.         var BGTitles2RerollFreq = parseInt(parameters['BGTitles2RerollFreq']);
    475.         if(BGTitles2RerollFreq == 1)
    476.         {
    477.             const GameEnd_commandToTitle = Scene_GameEnd.prototype.commandToTitle;
    478.             Scene_GameEnd.prototype.commandToTitle = function(){
    479.                 RerollBGTitles2();
    480.                 GameEnd_commandToTitle.call(this);
    481.             }
    482.             const Scene_Gameover_gotoTitle = Scene_Gameover.prototype.gotoTitle;
    483.             Scene_Gameover.prototype.gotoTitle = function(){
    484.                 RerollBGTitles2();
    485.                 Scene_Gameover_gotoTitle.call(this);
    486.             }
    487.             const Game_Interpreter_command354 = Game_Interpreter.prototype.command354;
    488.             Game_Interpreter.prototype.command354 = function(){
    489.                 RerollBGTitles2();
    490.                 Game_Interpreter_command354.call(this);
    491.             }
    492.         }
    493.     }
    494.     Scene_Title.prototype.createBackground = function() {
    495.         if(BGTitles1)
    496.         {
    497.             if(BGTitles1RerollFreq == 2)RerollBGTitles1();
    498.             this._backSprite1 = new Sprite(ImageManager.loadBitmap('img/titles1/', BGTitles1, BGTitles1Hue, false));
    499.         }else
    500.         {
    501.             this._backSprite1 = new Sprite(ImageManager.loadTitle1($dataSystem.title1Name));
    502.         }
    503.         if(BGTitles2)
    504.         {
    505.             if(BGTitles2RerollFreq == 2)RerollBGTitles2();
    506.             this._backSprite2 = new Sprite(ImageManager.loadBitmap('img/titles2/', BGTitles2, BGTitles2Hue, false));
    507.         }else
    508.         {
    509.             this._backSprite2 = new Sprite(ImageManager.loadTitle2($dataSystem.title2Name));
    510.         }
    511.         this.addChild(this._backSprite1);
    512.         this.addChild(this._backSprite2);
    513.     };
    514.     if(parameters['FGTitles2List'] != '' && parameters['FGTitles2List'] != '[]')
    515.     {
    516.         var FGTitles2List = JSON.parse(parameters['FGTitles2List']);
    517.         var FGTitles2HueRange = Math.max(parseInt(parameters['FGTitles2HueMax']) - parseInt(parameters['FGTitles2HueMin']), 0);
    518.         var FGTitles2Hue, FGTitles2;
    519.         function RerollFGTitles2(){
    520.             FGTitles2Hue = parseInt(parameters['FGTitles2HueMin']) + Math.randomInt(FGTitles2HueRange + 1);
    521.             FGTitles2 = FGTitles2List[Math.randomInt(FGTitles2List.length)];
    522.         }
    523.         RerollFGTitles2();
    524.         var FGTitles2RerollFreq = parseInt(parameters['FGTitles2RerollFreq']);
    525.         if(FGTitles2RerollFreq == 1)
    526.         {
    527.             const GameEnd_commandToTitle = Scene_GameEnd.prototype.commandToTitle;
    528.             Scene_GameEnd.prototype.commandToTitle = function(){
    529.                 RerollFGTitles2();
    530.                 GameEnd_commandToTitle.call(this);
    531.             }
    532.             const Scene_Gameover_gotoTitle = Scene_Gameover.prototype.gotoTitle;
    533.             Scene_Gameover.prototype.gotoTitle = function(){
    534.                 RerollFGTitles2();
    535.                 Scene_Gameover_gotoTitle.call(this);
    536.             }
    537.             const Game_Interpreter_command354 = Game_Interpreter.prototype.command354;
    538.             Game_Interpreter.prototype.command354 = function(){
    539.                 RerollFGTitles2();
    540.                 Game_Interpreter_command354.call(this);
    541.             }
    542.         }
    543.         const Scene_Title_createForeground = Scene_Title.prototype.createForeground;
    544.         Scene_Title.prototype.createForeground = function(){
    545.             if(FGTitles2RerollFreq == 2)RerollFGTitles2();
    546.             this._backSprite = new Sprite(ImageManager.loadBitmap('img/titles2/', FGTitles2, FGTitles2Hue, false));
    547.             this.addChild(this._backSprite);
    548.             Scene_Title_createForeground.call(this);
    549.         }
    550.     }
    551.     if(parameters['TitleBGMList'] != '' && parameters['TitleBGMList'] != '[]')
    552.     {
    553.         var TitleBGMList = JSON.parse(parameters['TitleBGMList']);
    554.         var TitleBGMVolume = parseInt(parameters['TitleBGMVolume']);
    555.         var TitleBGMPitchRange = Math.max(parseInt(parameters['TitleBGMPitchMax']) - parseInt(parameters['TitleBGMPitchMin']), 0);
    556.         var TitleBGM;
    557.         function RerollTitleBGM(){
    558.             let Pitch = parseInt(parameters['TitleBGMPitchMin']) + Math.randomInt(TitleBGMPitchRange + 1);
    559.             TitleBGM =
    560.             {
    561.                 name: TitleBGMList[Math.randomInt(TitleBGMList.length)],
    562.                 volume: TitleBGMVolume,
    563.                 pitch: Pitch,
    564.                 pan: 0
    565.             }
    566.         }
    567.         RerollTitleBGM();
    568.         var TitleBGMRerollFreq = parseInt(parameters['TitleBGMRerollFreq']);
    569.         if(TitleBGMRerollFreq == 1)
    570.         {
    571.             const GameEnd_commandToTitle = Scene_GameEnd.prototype.commandToTitle;
    572.             Scene_GameEnd.prototype.commandToTitle = function(){
    573.                 RerollTitleBGM();
    574.                 GameEnd_commandToTitle.call(this);
    575.             }
    576.             const Scene_Gameover_gotoTitle = Scene_Gameover.prototype.gotoTitle;
    577.             Scene_Gameover.prototype.gotoTitle = function(){
    578.                 RerollTitleBGM();
    579.                 Scene_Gameover_gotoTitle.call(this);
    580.             }
    581.             const Game_Interpreter_command354 = Game_Interpreter.prototype.command354;
    582.             Game_Interpreter.prototype.command354 = function(){
    583.                 RerollTitleBGM();
    584.                 Game_Interpreter_command354.call(this);
    585.             }
    586.         }
    587.     }
    588.     if(parameters['TitleBGSList'] != '' && parameters['TitleBGSList'] != '[]')
    589.     {
    590.         var TitleBGSList = JSON.parse(parameters['TitleBGSList']);
    591.         var TitleBGSVolume = parseInt(parameters['TitleBGSVolume']);
    592.         var TitleBGSPitchRange = Math.max(parseInt(parameters['TitleBGSPitchMax']) - parseInt(parameters['TitleBGSPitchMin']), 0);
    593.         var TitleBGS;
    594.         function RerollTitleBGS(){
    595.             let Pitch = parseInt(parameters['TitleBGSPitchMin']) + Math.randomInt(TitleBGSPitchRange + 1);
    596.             TitleBGS =
    597.             {
    598.                 name: TitleBGSList[Math.randomInt(TitleBGSList.length)],
    599.                 volume: TitleBGSVolume,
    600.                 pitch: Pitch,
    601.                 pan: 0
    602.             }
    603.         }
    604.         RerollTitleBGS();
    605.         var TitleBGSRerollFreq = parseInt(parameters['TitleBGSRerollFreq']);
    606.         if(TitleBGSRerollFreq == 1)
    607.         {
    608.             const GameEnd_commandToTitle = Scene_GameEnd.prototype.commandToTitle;
    609.             Scene_GameEnd.prototype.commandToTitle = function(){
    610.                 RerollTitleBGS();
    611.                 GameEnd_commandToTitle.call(this);
    612.             }
    613.             const Scene_Gameover_gotoTitle = Scene_Gameover.prototype.gotoTitle;
    614.             Scene_Gameover.prototype.gotoTitle = function(){
    615.                 RerollTitleBGS();
    616.                 Scene_Gameover_gotoTitle.call(this);
    617.             }
    618.             const Game_Interpreter_command354 = Game_Interpreter.prototype.command354;
    619.             Game_Interpreter.prototype.command354 = function(){
    620.                 RerollTitleBGS();
    621.                 Game_Interpreter_command354.call(this);
    622.             }
    623.         }
    624.     }
    625.     if(TitleBGM || TitleBGS)
    626.     {
    627.         Scene_Title.prototype.playTitleMusic = function() {
    628.             if(TitleBGMRerollFreq == 2)RerollTitleBGM();
    629.             if(TitleBGSRerollFreq == 2)RerollTitleBGS();
    630.             TitleBGM ? AudioManager.playBgm(TitleBGM) : AudioManager.playBgm($dataSystem.titleBgm);
    631.             TitleBGS ? AudioManager.playBgs(TitleBGS) : AudioManager.stopBgs();
    632.             AudioManager.stopMe();
    633.         };
    634.     }
    635. })();
    复制代码


    Note
    To use fonts other than GameFont, you will need another plugin that can preload fonts, such as Yanfly's Load Custom Fonts or SumRndmDde's Font Option Plugin.

    Terms of use

    • Free for commercial and non-commercial use, as long as I get a free copy of the game.
    • Edits allowed for personal use.
    • Do not repost or claim as your own, even if edited.
    • Do not use for training AI models. This includes, but is not limited to, inputting the plugin contents or part thereof into AI models that train on user input.
    Version history
    v1.0 - 2023/7/8- Initial release.

    Download link
    GitHub


    本贴来自国际rpgmaker官方论坛作者:AphoticAmaranth处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/random-title-screen-v1-0.159096/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-1 04:53 , Processed in 0.142122 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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