Okay, here's the thing. RPG Maker VX Ace's message system can be very flexible, to the point where you can use it as a basic credits system. However, sometimes you want that little bit more flexibility. So, at these times it would be very nice to see a credits system.
Now this isn't the best credits script there could be, hence its name. That doesn't mean it's bad though, it only means it's still very basic, kind of for people who want to work with a quick script, and that the code is a bit messy.
Installation
Make sure to put this below Materials, but above Main Process.
This script adds aliases for several methods. If you are sure no method that is used by other scripts get overridden, you can place it anywhere, otherwise, make sure this script is loaded after any other script overriding these methods, otherwise this script stops working.
Usage
SpoilerThere are two ways to use this script. First is changing the current scene to Scene_Credits. It will automatically return to the last scene after it's done. This scene is completely bare, save for the credits stuff. Any music or other effect should be done before this scene. You can also subclass it to add new functionality.
The other way is to open a Window_Credits. You can either open one yourself or use CXJ::HT_CREDITS.refresh to open a global window. You must run CXJ::HT_CREDITS.update yourself each tick to run the window. To close the window, use CXJ::HT_CREDITS.terminate_message. Finally, CXJ::HT_CREDITS.credits_end? checks if the credits reach its end.
A credits file is a regular text file which contains various data. It consists of several blocks, defined by square brackets. The [credits] section is the actual credits text. You can use certain formatting for that. None of the formatting will transfer over to the next line.
\IFT[icon_code] - Insert an icon font character.\C - Change color. The value that follows is four characters wide, and is a hexadecimal value representing RGBA.\{ - Enlargen the text by eight.\} - Shrink the text by eight.\Ax - Align the text to the center position. L: Align left. C: Align center. R: Align right.\Px - Sets the center position. L: At a quarter of the screen. C: At the center. R: At three quarters of the screen. 0-8: A position between the left and right position of the screen.\>> - Will process the next line on the same line as the current.There is also an easy way to insert unicode characters, by using \u{code}, where code is the hexadecimal code value of the glyph you want to insert. Do note that the u has to be lower case.
The [timeline] section defines events that should happen during the credits sequence. You can define methods here, either as a symbol or as an evaluated line. You correctly format the lines as follows:
time_in_seconds:method stringtime_in_seconds::symbolExample:
5.00
uts('Haldo world!')5.10::make_font_biggerThe [on_credits_end] block is actually a script block, which triggers once the script terminates, either by reaching the end or by getting terminated by the player. As the script is run inside the Window_Credits class, you can use the methods of this class inside this script.
Finally, [settings] contains the settings. You can assign settings however you like, if you like. If you decide not to change a setting, you can always remove them.
font - The font or fonts (comma separated and in double quotes).line_height - The font size.color - The font color, as an eight character hexadecimal value.duration - The duration of the credits sequence.scroll_duration - The duration of the scrolling text.speed - The speed of the scrolling text.
Icon fonts
Icon fonts are generally used for web applications, but I decided to add compatibility for it in this credits script. Basically an icon font is a font that only contains icons. This makes the images very scalable. To define an icon font, you need to make a hash, which contains the following blocks:
:name - The name of the font as it's defined in the font itself
refix - The prefix, used to identify the font:glyph - A list of glyphsThe glyph block in itself is a hash as well, where the key is the identifier of the font, and the value is the hexadecimal value associated with the glyph.
In the demo I've added an example. I've used FontAwesome as the icon font to show how it works. I also added a short bit below to show you the structure of the hash.
Code:
Script
Download
Spoiler Code:
Demo
Download v1.02
Download v1.01
Download v1.00
License

To the extent possible under law, Gary A.M. Kertopermono has waived all copyright and related or neighboring rights to this work.
本贴来自国际rpgmaker官方论坛作者:GaryCXJk处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/hacked-together-credits-script.30660/