Your text files:
They must be a raw text file, with no formatting saved in it. So you cannot use WordPad, Word, Wordperfect or any other program beside Notepad.
Save it as ANSI or UTF-8 if you need extra-foreign character like é or à -- Don't use the other format.
The text that will be used in the scrolling window is taken in your text files. You just have to create a directory named "Text" in your project root folder, and put your text in it. You can have the extention you want, you will have to specify it when calling the window in your scripts/events. I named them rxdata to make them fit with the rest... But they are just TXT files. Take note that for book, your are obligated to use .rxdata as your file extention. (Use RIGHT-CLICK and choose OPEN WITH>NOTEPAD in Win XP for fast access.)
When you write in your text file (using notepad), make sure to make short lines, remember that the screen of RMXP is a bit less than 640 pixel width. Make some test, and adjust yourself accordingly. Your text file can be as long as you want, but the longer they are, the longer it is to build the window.
About foreign language/character:
You can use foreign characters, as french or german one, in the script, as the following characters:
ß ä ¼ ê «
All you need to do to allow the characters like those to show up is to save your text file as UTF-8 with Notepad. (Open Notepad, choose SAVE AS, and select the last option, should be UTF-8).
There is one important thing to remember using this, and it's that you cannot use the color code to change the color of the text on the first line, but you can on any other line. So if you need to set the first line as another color, for a title or something, simply leave an empty line on the beggining of the file, and start your true text on line 2.
Using colors code:
I coded something in the script that will allow you to specify a color for the line and also a color for the main text being displayed, so your stories or credits can be a little bit more interesting.
-> The Line Color code:
The line color code will change only one line to a specific color, and that's all. To do so, you must begin the line with a * sign, followed by the 2 digits representing the color ID you want to use. Those color ID are defined in the class Window Base, and you can add as much as you desire. You must use 2 digits, so put a 0 in front of it if the number is below 10... like 07. And do not use space between the words and the syntax. Here's a example:
*06Hi, what's up ? I don't know !!!
You will be able to use the * sign elsewhere in the lign, because I just check the first character for it.
-> The Main Color code:
The main color code allow you to specify a color for the entire text, without the need of inserting the line code (*) before each line. To use it, you have to start your line with a / symbol followed by the 2 digit representing your color ID. You can use the / sign anywhere but not as the first character, unless you want to specify a color. So if you want the text to be yellow, you use /06 as the line start. This code will make the entire text become of the color you specified, without you having to add a * code in each line. You can still use the * code to change a line color, and the color will return to the one you specified with / after it's been drawn. You can change the color with another / anytime, and the color of
all line will now be of that new one. Have fun ! Here's an example:
/06Hi, what's up ? I don't know !!!
The syntax to call the scrolling window:
You can use that syntax in a Call Script with an event, or within your own script/scene. The syntax is the following:
Text_Scroller.new("FileName", scroll_opacity, bg_opacity, speed, Live Scroll?)
FileName Is where you write the exact same filename (with the extention) of your text file within the Text folder. Take note that you can do sub folders to classify your things, just incluse the path in the filename. Here's 2 example:
Text_Scroller.new("Credits Demo.rxdata", 0,0, 2, 0)
#Will use the file in Text\Credits Demo.rxdata
Text_Scroller.new("MyStuff/Credits Demo.rxdata", 0,0, 2, 0)
#Will use the file in Text\MySTuff\Credits Demo.rxdata
Something important to remember is that in RGSS, the \ (backslash) character used in windows in drive path is a / (slash) character; as on the web.
scroll_opacity Set the opacity of the window in which the text will scroll. 255 is opaque, and 0 is transparent. I suggest you set it to 0 and tint the screen, or use a background pictures, it's give better results.
bg_opacity Set the opacity of the "dummy" background window. You can now have a window displayed behind the scrolling text, sized to 640X480 (full screen), if you dont want to use it, simply set its opacity to 0. 255 is opaque, and 0 is transparent.
speed Set the speed at which the text will scrolls. The minimum (slower) speed is 1. If you do story, it's a good idea to make a lot of paragraph and add extra empty lines between them so the player can read the text. Check the demo.
Live Scroll? The last option is the Live Scroll option. When set to 0, the player and every other event processing will stop. If you set it to 1,event
processing and the player controls will be available, meaning that the player will be able to move around while the text is scrolling and it also means that event processing... (Parallel, Auto, and all other type) will still work perfectly. Use this to create better cut scene and intro story.
Remember the Trick to stop/enable the control of the hero with a Move Event.You do a move event "Move Toward Hero" on the player itself, it then freezes.To regain control use a "Face Hero" (Face Player) command on the hero again. Neat !
You can also allow/disallow menu with a simple event commands. Look at the demo !
The syntax to call The Book Scroller:
New from Release 3, you now can use Books without any common events, without any game variables and without any game switches; it's 100$ script ! Here's the syntax to call a book:
Book_Scroll.new("
book_title",
number_of_pages,
start_page,
book_window,
bg_window)
"
book_title" The book title is where you specified the title of your book. It must be the name of the directory where you put your pages in. This book directory must be in the Text directory.
Example: Text\My Book
number_of_pages You must specify a total number of pages so the script can carry out everything by itself. If your page have 10 pages, you put a 10 in there.
REMEMBER: All your pages must be only a number starting from 1. And the extention must be .rxdata
EXAMPLE: For a 5 pages book, the files in your book directory would look like that:
1.rxdata
2.rxdata
3.rxdata
4.rxdata
5.rxdata
start_page Here you specify on which page the book should be opened. Insert 1 to open page 1 as default.
book_window Set the opacity of the window in which the text will scroll. 255 is opaque, and 0 is transparent. I suggest you set it to 0 and tint the screen, or use a background pictures, it's give better results.
bg_window Set the opacity of the "dummy" background window. You can now have a window displayed behind the scrolling text, sized to 640X480 (full screen), if you dont want to use it, simply set its opacity to 0. 255 is opaque, and 0 is transparent.
When using the "Book Syntax" to call a book, be sure to add a event command "Allow/Disallow Main Menu" and choose "Allow" right after the call script of the book. Add a wait of 5 frames between the two. It should look like that:
-> Message
-> Call Script - Calling your book
-> Wait 5 frames
-> Allow/Disallow Main Menu-Allow
This will be fixed in future release.