Text Alignment and Face Control Script V2.0 Created by Neon Black
What is it? This script allows you to change the default alignment of the text as well as the default position of a face displayed in the textbox. It also includes several textbox codes that allow you to change these settings on the fly as well as align the lines in the textbox differently. I created this script because the I could only find one other script that would allow the user to change the alignment of text and I didn't want all the extra baggage that script came with or any potential compatibility issues.
What are its features? This script now has the ability to change how facesets are used by the program. You can now use facesets different sizes than the standard 96x96 pixels. Facesets must still contain 8 faces total (4 horizontal and 2 vertical) but you are no longer restricted by size. You may also use a single graphic for a face by adding "$" to the image name, similar to what you would do with character sets. These features are always available in the text box, but to use these features anywhere else, you must enable them in the advanced options.
How can I use it? Place this script anywhere in the materials section above main. If you notice incompatibility with another script, place this script above that script. If you still experience incompatibility issues, please post what scripts you are using as well as what kind of error you are getting.
Default Alignment - The position of the text in a textbox by default.
Monster Text on Appearance - The text that displays when a monster appears (due to a known bug).
Type or Skip Text - The way the text displays by default; instant or typed.
Default Swapping - The side the face appears by default.
Default Flipping - The direction the face looks by default.
X Offset - Moves the face around on the screen. Positive values move it to the right.
Y Offset - Moves the face around on the screen. Positive values move it UP.
Text Offset - The X offset of the text within the message box. This only takes affect when there is a face in the box. If Face Lay is set to false, this much of the message box will be trimmed off, making it smaller.
Default Face Lay - Determines if the face will be displayed over the message box.
Advanced Mode - Enables or disables all Advanced mode options at once. Must be set to true for any to work.
Face Mod - Overwrites how faces are drawn in general. This will modify such things as how faces are drawn in the menu. See the instructions for face set changes.
Text Mod - Adds the advanced commands to the list. See the codes section to see the new advanced commands.
Text Style - Determines how text is drawn on screen. 0 turns it off, 1 uses dynamic shadows, 2 uses outlined text.
Shadow X and Y - The X and Y offsets of the shadow. Change these values to move the shadow around. Has no effect on outlined text.
Shadow Color - The color the shadow or border will display as. Requires a red, green, and blue value. Alpha is determined by the text.
Alignment and face codes must be LOWERCASE to work.
\alil, \alic, \alir, \al, \ac, \ar - Aligns the textbox to the left, center, or right side.
\pos[x:y] - Aligns row "x" (1-4) to side "y" (0 for left, 1 for center, 2 for right). Note! This was changed from \ali in V1.1. The \ali command no longer works and needs to be changed to this!
\right, \left, \r, \l - Sets the side the face appears on and the direction it's looking.
\flip, \uflip, \f>, \f< - Mirrors or un-mirrors the face.
\swap, \uswap, \s>, \s< - Swaps the position of the face but does not flip it. "\swap" places it on the right, "\uswap" places it on the left.
\keep, \k - (v1.1) Saves face information for the next message box or choice window.
\trans[x], \t[x] - (v1.1) Sets the opacity of the face to value "x" where 255 is fully visible and 0 is fully transparent.
Advanced Commands: (Reqruire Text Mod be enabled to work; may be uppercase or lowercase.)
\icon[x] - Display icon number "x" in the text box.
\b - Toggles bold text on or off. Note! Bold text will not align properly and proper alignment will not be supported in the future.
\i - Toggles italic text on or off.
\fi[x] - Changes the current face to index "x" from the faceset. "x" must be a value from 0-7. Will have no effect when using single graphic faces.
What does it look like?
What does it work with? This script was made to work alongside the Yanfly Custom Message System. To use these scripts together, place this script ABOVE the Yanfly CMS.
This script overwrites a few of the class objects in order to work and will most likely be incompatible with scripts that use them differently. Below are the changes this script makes.
I would like to use this code. You are free to use, modify, copy and distribute this code at your own leisure and you do not need to credit me directly, however if you use this code or modify it in any way, please leave the names in the credits box at the top of the code and do not remove that section.
Author's Disclaimer: This is the first script I created from scratch and I am sort of proud of it, though I am sure there are bugs and errors or better ways of doing things. Due to errors I created while taking time adjusting to a new language there is a certain amount of redundancy in the code. There are also some things split apart because I plan to add more features to the code at a later date. The code should work for now. Any problems you may encounter please post here or PM me and I will certainly help resolve them.
This post has been edited by Neon Black: Mar 21 2012, 12:37 PM
Modified the script to fix several bugs involving selection boxes and the battle messages. Also added 2 new message codes for use as explained below. For screenshots of the new features, check the main post. Current version is now 1.1.
\trans[x] - This code allows you to set the opacity of the face by changing "x" to a value from 0 to 255. Setting it to 255 will make it fully visible (default) while setting it 0 makes it fully transparent.
\keep - This saves the face, position, flipping, and transparency of the current message box for the next message box or selection screen. The main use of this is to allow you to display a face in a choice box with 4 choices.
This post has been edited by Neon Black: Oct 25 2011, 05:06 AM
I feel like I'm almost breaking a rule, but I've updated this script quite a bit with several new features (see the pictures in the main post for reference).
First of all, for the simple additions, I've added several commands to work the same as the old commands. For alignment, \al, \ac, and \ar may be used. For flipping the face, \f> may be used to flip it and \f< may be used to "unflip" it, or return it to it's normal direction. For "swapping" the face, or changing which side it's on, \s> may be used and \s< will return it to the default position. For transparency, \t[x] may now be used. For saving the face settings and using it in the next textbox, \k may be used.
One important change to note is that the old \ali[x:y] command had to be changed. It is now \pos[x:y].
You can now use larger and smaller sized face sets in the text box. They follow the same 8 panel restriction as the default facesets unless you add "$" to the graphic name, similar to character sets. In order to use differently sized faces in other places, advanced mode must be enabled (see below).
Advanced Mode: There are several other changes that require advanced mode to be enabled before they take effect. These are grouped into 3 categories and can be individually turned on and off. Turning them on may cause the script to lose some compatibility.
First of all, there are 4 new text based commands that add features to the text box. \icon[x] can be used to display an icon in the text box. \b can be used to bold all following text and used again to cancel bold text. \i can be used to make text italic or return it to normal. \fi[x] is a bit of an odd command. This will cause the face displayed to change in the text box. This will allow you to change a face's emotions in the middle of a sentence. To use any of these command, the Text Mod option must be enabled.
Second, you have the option to change how a text's shadow is displayed. You must first choose a display type (1 for dynamic shadow, 2 for outlined text, 0 turns this option off completely). If dynamic shadow is selected, you can move the position of the shadow around to display more or less as you please. The shadow color option will change the color of text's shadow or border.
Finally, you have the option to use the new and improved faces system. This system changes how facesets are handled and you will honestly probably not see any difference with the default face sets. This option will allow you to use facesets larger and smaller than the default values, though you are still restricted to 8 faces per set. As with the text box faces, you can also use "$" in the graphic name to use a single graphic for a single face.
I also feel the need to point out that one of the added pictures shows a portrait style face and a smaller than normal text box. To do this, change the "DEFAULT_FACE_LAY" option to false and set the "TEXT_OFFSET" to a positive number. The textbox will automatically be shortened by that number of pixels. As far as I can tell, alignment and other features are adjusted accordingly, but it is still worth being careful how you use this feature. Advanced mode does NOT have to be enabled to do this.
Make an introduction of yourself here! Don't be shy! We don't bite! At least, I don't!
If you have problems with Switches, Variables or anything else related to events, take a look at Aindra'sRPG Maker VX School, the best tutorial ever! Download the Practice Events to test your eventing skills!
Post projects made in RPG Maker VXhere! Read the Rules and Guidelines before posting! Projects on any other program come here. Be sure to play other people's games too.
Check out our resources here! Request resources here. Make sure you read this and this before requesting!
Have any troubles using VX? Ask for help here! Read this, this and this before asking for help.
Get scripts for your game here! Don't say "Your script gives me an error saying "superclass mismatch"! What do I do?". If this happens, you're using VX Ace, and there's no other way around this than requesting it to be converted to RGSS3here.
Request scripts for VX, and ONLY VX, here! If you have trouble using a script, ask for help here.
If you're working too much on your projects, take a rest here and here!
Do you use RPG Maker VX Ace Lite? Come to the brand new Ace Lite section found here! I just don't know why is there a scripting section inside it, as Ace Lite has no scripting support, from what I've heard.
Well, I think that's all. If you have any questions, don't be afraid to ask, like I am!