システムフォント設定プラグイン – RS_MessageSystem.js

タイトル
Hangul Message System
作者名
ヘルプ
//! ===================================================================
//! Introduction
//! ===================================================================
This plugin allows you to use text codes in English, Korean, Chinese, Japanese.

To send me general feedback, simply send an e-mail to biud436(gmail.com)
and mention the plugin name via the subject of your message.

But, This plugin also provide the text codes in English instead of Korean.
To use the text codes in English,
You must set with 'en' in the plugin parameter named 'Language Code'

English Text Codes :

\COLOR[html_color_name]
\TEXT_SPEED[value]
\OUTLINE_COLOR[color_name]
\OUTLINE_WIDTH[value]
\INDENT[value]
\BOLD!
\ITALIC!
\NAME<event_name>
\GRADIENT<text>
\PARTY_MEMBER[nth]
\PLAYER[nth]
\VAR[nth]
\ICON[nth]
\INCREASE!
\DECREASE!
\GOLD
\BALLOON[event_id]
\BALLOON[0]
\BALLOON[-1]
\ALIGN[1]
\ALIGN[2]
\NUM[number]
\TEXT_SIZE[number]
\TAB!
\CR!
\PLAY_SE<se_name>
\SHOW_PICTURE<nth, picture_name, origin_number, x, y>
\HIDE_PICTURE[nth]
\ITEM[nth]
\WEAPON[nth]
\ARMOR[nth]
\CLASSES[nth]
\ENEMY[nth]
\STATE[nth]
\SKILL[nth]
\FACE<face_name,face_index>
\FRIENDLY_TROOPS[nth]
\ENEMY_TROOPS[nth]
<B></B>
<I></I>
<LEFT></LEFT>
<CENTER></CENTER>
<RIGHT></RIGHT>
\HC[color_name]
\FD[face_position]

//? ===================================================================
//? Opening the name window
//? ===================================================================
The name window is executed once before all the text codes start.
and automatically transforms the name window to fit the width of the text area.

To open the name window, do as follows.
You put the name text between Less-than sign and Greater-than sign.

\NAME<text>

You can add a certain command by attaching a colon(:) at the end of the name text.
To change the position of the name window, as follows.

\NAME<text:left>
\NAME<text:right>
\NAME<text:center>

To change the opacity of the name window, as follows.

\NAME<text:opacity0>
\NAME<text:defaultOpacity>

To set the name window above the speech balloon, as follows

\BALLOON[0]\NAME<eric>\COLOR[red]hello?

To change the text color in the name window, as follows

\NAME<\COLOR[red]eric>

//? ===================================================================
//? Opening the speech balloon window
//? ===================================================================
The speech balloon window is executed once before all the text codes start.
and transforms the message window to fit with a target sprite and changes the position of it, too.

To create a new speech balloon window and indicate, do as follows.

You put the index between square brackets.
if the index sets to 0, it'll set to a current event.
if the index sets to -1, it'll set to a player.

\BALLOON[event_id]
\BALLOON[0]current event
\BALLOON[-1]player

In the battle, To indicate the window in above the battler, do as follows.
it can obtain the nth battler of the party members and indicate the message window.

\FRIENDLY_TROOPS[nth]
\FRIENDLY_TROOPS[1] is the same as \BALLOON[1] and it can obtain the second FRIENDLY battler.
\FRIENDLY_TROOPS[2] is the same as \BALLOON[2]

This can obtain the nth battler of the enemy troops and indicate the message window.

\ENEMY_TROOPS[nth]
\ENEMY_TROOPS[1] is the same as \BALLOON[-1]
\ENEMY_TROOPS[2] is the same as \BALLOON[-2]

Note that it will appear as the normal message window if the battler is in a dead state or does not exist.

\BALLOON[1] party member 1
\BALLOON[2] party member 2
\BALLOON[3] party member 3
\BALLOON[4] party member 4
\BALLOON[5] if the party member 5 is not existed, the target sets as party member 4.
\BALLOON[-1] enemy 1
\BALLOON[-2] enemy 2

In the battle, it must put a negative or positive numbers between square brackets.
if you put to 0, it indicates as the normal message window.

\BALLOON[0] normal message window

//? ===================================================================
//? Changing the text speed.
//? ===================================================================
This text code is applied once in the one page so in the other page has been invalid.

To change the text speed in the message window, as follows.

\TEXT_SPEED[frame]

You put the speed value between square brackets.
if the value is to 0, The text will be drawn without delay.
if the value is to 1, The text will be drawn every 1 frame.

Note that it will be reset with initial value when starting the next page.

//? ===================================================================
//? Making the bold and the italic text.
//? ===================================================================
To change the font setting, it is possible to do bold and italic
settings by using a html tag such as <B></B><I></I>.

For Example, you could use the following things.

\BALLOON[0]\NAME<Wanderers>Hello. <B>Eric.</B> <I>Welcome to the game.</I>

//? ===================================================================
//? Indenting the text
//? ===================================================================
To indent the text in the current page, as follows.
you can put the number for indent between square brackets.

\INDENT[value]

For instance, you are possible to use as follows.

\indent[10]Leaves change their color in the fall

Notice that the indent settings resets with initial value in the next page starts up.

//? ===================================================================
//? A Text Alingment
//? ===================================================================
You can use a html tag such as <CENTER>, <LEFT>, <RIGHT> in the message window.
For instance, You can use as follows.

<CENTER>The god appeared in the from of a fairy</CENTER>
<RIGHT>The robbers hid in the bushes and fell on me from four sides.</RIGHT>

//? ===================================================================
//? Setting the standing CG.
//? ===================================================================
This plugin allows you to show up the large face image on the message window.

To set the large face image that means the standing CG,
You must place Big_.png that starts with prefix called Big_ from the img/faces folder
on your root project folder.

so it will be going to create using img/faces/Big_.png

and then you select the face index that can set the position of it.

The face image has an index, as follows:

0 1 2 3
4 5 6 7

For instance,
if the face index is to 0, the face image will show up on the left of message window.
if the face index is to 1 or more, the face image will show up on the right of message window.

To change a standing CG after the message window starts up, you can use this text code.

\FACE<face_name,face_index>

You put the face name and face index between Less-than sign and Greater-than sign, as follows

\FACE<Big_ScaredActor,0>

But, this text code should be used for a special purpose.
You should preload the face image because loading image is the asynchronous.
Otherwise, You will not be going to show anything.

//? ===================================================================
//? Changing the position of face image.
//? ===================================================================
To change the face image to the right side of message window, as follows.

You can use the text code called \FD[2] or
use the plugin command called 'Message facePos 2'

To show up the face image again to the left side on the message window,
You can use the text code called \FD[0] or use the plugin command called 'Message facePos 0'

//? ===================================================================
//? Dealing with colors
//? ===================================================================
You can various color code such as web hex code or built-in color.
it can use them everywhere that can use text codes.

\COLOR[c_red]
\COLOR[c_silver]
\COLOR[c_normal]
\COLOR[#ffffff]
\COLOR[aqua]
\COLOR[rgb(255, 0, 0)]

\OUTLINE_COLOR[color_name]

To change the background color of your text area, do as follows.
\HC[color_name]

To use web colors, you must pass hex format like as #RRGGBB.
For example, the lime color is to \COLOR[#00FF00] or \COLOR[lime]

//! ===================================================================
//! Plugin Commands
//! ===================================================================

Changes the text speed. The n is the delay frame of each character:

Message textSpeed [n]

Message fontSize [n]

Changes the offset position of the message window. the n is the number value:

Message offsetX [n]
Message offsetY [n]

Message minFontSize [n]
Message maxFontSize [n]

Changes the number of lines in which it appears on the message window.
Notice that the number of lines must restore as default value after changing lines:

Message line [n]

Message textStartX [n]

Changes the offset or the padding of the name window in which it appears above the message window.
Message name x [n]
Message name y [n]
Message name padding [n]

Changes the windowskin in which it appears on the name window.
Notice that you need to preload the window skin before starting the name window.
if not, it can fail to correctly get the text color table inside the window skin.
Message name windowskin [...]

Changes the offset of the large face image in which it appears on the screen.
Message faceOX [n]
Message faceOY [n]

Changes the large face image's z-index in which it appears on the message window.
if the z-index is to 0, the face image will show up in front of the message window.
if it is to -1, the face image will show up behind the background image of the message window.

Message faceZ -1
Message faceZ [n]

Changes the position of the normal face image in which it appears on the message window.
By default, the face image will be located at the left side of the message window.
if you use this plugin command, you can change the position of the face image.
if the value is to 2, it will be located at the right side of the message window.
if the value is t0 0, it will be located at the left side of the message window.

Message facePos [n]

Changes the size of the tab, which adds a space when you are used the text code called '\TAB!'
Message setTabSize [n]

Message backgroundOpacity [n]
Message contentsOpacity [n]

Changes the windowskin in which it appears on the message window.
Notice that you need to preload the window skin before starting the message window.
if not, it can fail to correctly get the text color table inside the window skin.

Message windowskin [...]

Changes the word wrap settings.
if true, it will be going to remove a custom line break in all of lines and it fills the texts finely.

Message minifier true
Message minifier false
パラメータ
param Font Size
type number
desc Specifies the text size as integer type.
(default : 28)
default 28

param numVisibleRows
type number
desc Sets the number of rows to indicate in a message window.
default 4
min 1
param gradientColor1
desc Sets needed gradient color for the start point of the gradient text.
default #FFFFFF

param gradientColor2
desc Sets needed gradient color for the middle point of the gradient text.
default #F29661

param gradientColor3
desc Sets needed gradient color for the ended point of the gradient text.
default #CC3D3D

param Text Speed
type number
desc Sets the default text speed
default 0
min 0

param Text Min Size
type number
desc limits the text size by specifying the minimum text size when using the text code called '\}'.
default 24

param Text Max Size
type number
desc limits the text size by specifying the maximum text size when using the text code called '\{'.
default 96

param Text Start X
type number
desc The starting x position of the text in case of using a large face bitmap.
default 6

param Bust Option

param Big Face OX
parent Bust Option
type number
desc Sets the large face bitmap's offset x
default 0

param Big Face OY
parent Bust Option
type number
desc Sets the large face bitmap's offset y
default 0

param face Opacity
parent Bust Option
text Big Face Opacity
type number
desc Set the opacity of the large face.
(0 - 255)
default 255

param Show Big Face Back
text Face Z-Index
parent Bust Option
type boolean
desc if true, the bust image'll show behind the background of the message window.
default false
on true
off false

param face Direction
parent Bust Option
text Face Position
type select
desc Specify the position of the normal face image.
default 0
option Left
value 0
option Right
value 2

param Tab Size
type number
desc Sets the maximum width for tabs.
default 4

param back Opacity
type number
desc Sets the opacity of the message window for backgrounds.
default 192

param default Opacity
type number
desc Sets the default opacity of the message window.
default 255

param contents Opacity
type number
desc Sets the opacity of the message window for all contents.
default 255

param translucent Opacity
type number
desc Sets the translucent opacity of the message window.
default 160

param default outline width
type number
desc Specifies the maximum width for text borders.
default 2

param default outline Color
desc Specifies the color for text borders.
default rgba(0, 0, 0, 1.0)

param Default Windowskin
desc Specifies a window skin to message window
require 1
default Window
dir img/system/
type file

param System Font Settings

param systemFont
parent System Font Settings
text System Font
type struct<SystemFont>
desc The font is setting up as the system font.
default {"settings":"[\"{\\\"languageCode\\\":\\\"ko\\\",\\\"fontName\\\":\\\"나눔고딕, Dotum, AppleGothic, sans-serif\\\"}\",\"{\\\"languageCode\\\":\\\"zh\\\",\\\"fontName\\\":\\\"SimHei, Heiti TC, sans-serif\\\"}\"]"}

param Custom Font

param Using Custom Font
parent Custom Font
type boolean
desc Do you wish to use a custom font?
default false

param Custom Font Name
parent Custom Font
desc Specifies the name for fonts
default NanumBrush

param Custom Font Src
parent Custom Font
desc Specifies the file path for fonts
default fonts/NanumBrush.ttf

param Choice Window

param Choice Style
parent Choice Window
type select
desc Can change as the desired choice window style
default default
option RMXP Style
value RMXP
option Default Style
value default

param Default Choice Position
parent Choice Window
type select
desc Set the position of the choice window.
default right
option Right (Default)
value right
option Middle (Center)
value middle
option Left
value left

param Name Window

param Name Windowskin
parent Name Window
desc Specifies a window skin for a name window
require 1
default Window
dir img/system/
type file

param Name Window X
parent Name Window
type number
desc Sets the name window's offset x by dx.
default 0

param Name Window Y
parent Name Window
type number
desc Sets the name window's offset y by dy.
default 0

param Name Window Inner Padding
parent Name Window
type number
desc Sets the name window's inner padding
default 10

param Name Window Position
parent Name Window
type select
desc The name window's position sets up as certain position in message window
default left
option Top of left (default)
value left
option Top of right
value right

param Text Color
type struct<TextColor>[]
desc This allows you to add desired text color.
default ["{\"Color Name\":\"c_lviolet \",\"Red\":\"200\",\"Green\":\"191\",\"Blue\":\"231\",\"Alpha\":\"1.0\"}"]

param Text Code
type struct<TextCode>
desc Can change with desired text codes
default {"Korean":"[\"색\",\"속도\",\"테두리색\",\"테두리크기\",\"들여쓰기\",\"굵게!\",\"이탤릭!\",\"이름\",\"그레디언트\",\"파티원\",\"주인공\",\"변수\",\"아이콘\",\"확대!\",\"축소!\",\"골드\",\"말풍선\",\"정렬자\",\"숫자\",\"크기\",\"탭!\",\"캐리지리턴!\",\"효과음\",\"그림표시\",\"그림제거\",\"아이템\",\"무기구\",\"방어구\",\"직업\",\"적군\",\"상태\",\"스킬\",\"얼굴\",\"아군\",\"적그룹\",\"[.]\",\"[|]\",\"[!]\",\"[<]\",\"[>]\",\"[\\\\^]\",\"AS굵게!\",\"AE굵게!\",\"AS이탤릭!\",\"AE이탤릭!\",\"LEFT\",\"CENTER\",\"RIGHT\",\"B\",\"B\",\"I\",\"I\",\"AEND\",\"배경색\",\"FD\"]","Chinese":"[\"色\",\"速度\",\"轮廓颜色\",\"轮廓宽度\",\"缩进\",\"加粗!\",\"倾斜!\",\"名字\",\"渐变颜色\",\"队伍成员\",\"角色\",\"变量\",\"图标\",\"增大!\",\"减少!\",\"金币\",\"对话框\",\"对齐\",\"数\",\"大小\",\"TAB!\",\"CR!\",\"音效播放\",\"显示图像\",\"隐藏图像\",\"道具\",\"武器\",\"装甲\",\"职业\",\"敌人\",\"状态\",\"技能\",\"脸\",\"我军\",\"敌人组\",\"[.]\",\"[|]\",\"[!]\",\"[<]\",\"[>]\",\"[\\\\^]\",\"AS加粗!\",\"AE加粗!\",\"AS倾斜!\",\"AE倾斜!\",\"左\",\"中間\",\"右\",\"B\",\"B\",\"I\",\"I\",\"AEND\",\"HC\",\"FD\"]","English":"[\"COLOR\",\"TEXT_SPEED\",\"OUTLINE_COLOR\",\"OUTLINE_WIDTH\",\"INDENT\",\"BOLD!\",\"ITALIC!\",\"NAME\",\"GRADIENT\",\"PARTY_MEMBER\",\"PLAYER\",\"VAR\",\"ICON\",\"INCREASE!\",\"DECREASE!\",\"GOLD\",\"BALLOON\",\"ALIGN\",\"NUM\",\"TEXT_SIZE\",\"TAB!\",\"CR!\",\"PLAY_SE\",\"SHOW_PICTURE\",\"HIDE_PICTURE\",\"ITEM\",\"WEAPON\",\"ARMOR\",\"CLASSES\",\"ENEMY\",\"STATE\",\"SKILL\",\"FACE\",\"FRIENDLY_TROOPS\",\"ENEMY_TROOPS\",\"[.]\",\"[|]\",\"[!]\",\"[<]\",\"[>]\",\"[\\\\^]\",\"ASBOLD!\",\"AEBOLD!\",\"ASITALIC!\",\"AEITALIC!\",\"LEFT\",\"CENTER\",\"RIGHT\",\"B\",\"B\",\"I\",\"I\",\"AEND\",\"HC\",\"FD\"]","Japanese":"[\"色\",\"テキストスピード\",\"輪郭の色\",\"輪郭のサイズ\",\"インデント\",\"太字!\",\"斜体!\",\"名前\",\"グラデーション\",\"パーティーメンバー\",\"アクタ\",\"変数\",\"アイコン\",\"INCREASE!\",\"DECREASE!\",\"通貨単位表示\",\"フキダシ\",\"整列\",\"数字\",\"テキストのサイズ\",\"TAB!\",\"CR!\",\"効果音\",\"ピクチャの表示\",\"ピクチャの消去\",\"アイテム\",\"武器\",\"防具\",\"職業\",\"敵キャラ\",\"ステート\",\"スキル\",\"顔\",\"FRIENDLY_TROOPS\",\"ENEMY_TROOPS\",\"[.]\",\"[|]\",\"[!]\",\"[<]\",\"[>]\",\"[\\\\^]\",\"AS太字!\",\"AE太字!\",\"AS斜体!\",\"AE斜体!\",\"LEFT\",\"CENTER\",\"RIGHT\",\"B\",\"B\",\"I\",\"I\",\"AEND\",\"HC\",\"FD\"]"}

param Sound Effects

param Text Sound ON/OFF
parent Sound Effects
type boolean
default true

param Text Sound
parent Sound Effects
type file
dir audio/se/
desc Plays back the text sound when processing for each text.
default Cursor1
require 1

param Text Sound Execution Condition
parent Sound Effects
type note
desc Make the probability to play the text sound.
default "Math.randomInt(100) < 45"

param Text Sound Pool Size
parent Sound Effects
type number
desc Specify the size of the text sound pool.
default 2
min 1

param Text Sound Interval
parent Sound Effects
type number
desc Specify the text sound interval.
default 2
min 1

param Text Sound Volume
parent Sound Effects
type note
desc Make the volume of the text sound by the random value that is float between 0.0 and 1.0
default "0.4"

param Language Code
type select
desc Specify the language code of the text codes.
default en
option English
value en
option Korean
value ko
option Japanese
value ja
option Chinese
value zh

param preload windowskin
require 1
dir img/system/
type file[]
desc preload windowskin files
default
param Window Width
text Window Width
type string
desc Specify the window width
(Graphics.boxWidth is the same as the screen width)
default Graphics.boxWidth

param Gradient Style
text Gradient Style
type select
desc Specify the gradient style.
default linear-horizontal
option linear-horizontal
value linear-horizontal
option axial-horizontal
value axial-horizontal
option linear-vertical
value linear-vertical
option axial-vertical
value axial-vertical
option radial
value radial

param Paragraph Minifier
text Automatic New Line
type boolean
desc Specify whether the word wrap is used.
(The default value is to false)
default false
on true
off false

ライセンス表記
The MIT License
Copyright (c) 2015 biud436
Free for commercial and non commercial use.

紹介ページ https://github.com/biud436/MV/blob/master/RS_MessageSystem.js