<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">//=============================================================================
// DTextPicture.js
// ----------------------------------------------------------------------------
// (C) 2015 Triacontane
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
// ----------------------------------------------------------------------------
// Version
// 1.20.0 2020/07/11 ã™ã¹ã¦ã®å‹•çš„æ–‡å­—åˆ—ãƒ”ã‚¯ãƒãƒ£ã«ä»˜ä¸Žã•ã‚Œã‚‹æŽ¥é&nbsp;­è¾žãƒ†ã‚­ã‚¹ãƒˆã‚’æŒ‡å®šã§ãã‚‹æ©Ÿèƒ½ã‚’è¿½åŠ&nbsp;
// 1.19.0 2020/04/09 ãƒ•ãƒ¬ãƒ¼ãƒ&nbsp;ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã«ä½™ç™½ã‚’æŒ‡å®šã§ãã‚‹æ©Ÿèƒ½ã‚’è¿½åŠ&nbsp;
// 1.18.0 2020/04/05 åˆ¶å¾¡æ–‡å­—\v[n, m]ã§åŸ‹ã‚ã‚‰ã‚Œã‚‹æ–‡å­—ã‚’ãƒ‘ãƒ©ãƒ¡ãƒ¼ã‚¿ã‹ã‚‰æŒ‡å®šã§ãã‚‹æ©Ÿèƒ½ã‚’è¿½åŠ&nbsp;
// 1.17.0 2020/02/07 èƒŒæ™¯ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã®ã‚¹ã‚­ãƒ³ã‚’å¤‰æ›´ã§ãã‚‹æ©Ÿèƒ½ã‚’è¿½åŠ&nbsp;ã—ã€ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ãƒ“ãƒ«ãƒ€ãƒ¼ã«å¯¾å¿œ
// 1.16.0 2020/02/01 è¤‡æ•°è¡Œè¡¨ç¤ºã—ãŸå&nbsp;´åˆã®è¡Œé–“ã‚’æŒ‡å®šã§ãã‚‹æ©Ÿèƒ½ã‚’è¿½åŠ&nbsp;
// 1.15.1 2019/12/29 YEP_PluginCmdSwVar.jsã¨ä½µç”¨ã—ãŸã¨ãã€å¤‰æ•°ã®ãƒªã‚¢ãƒ«ã‚¿ã‚¤ãƒ&nbsp;å¤‰æ›ãŒåŠ¹ã‹ãªããªã‚‹ç«¶åˆã‚’ä¿®æ­£
// 1.15.0 2019/10/21 ã‚«ãƒ¼ã‚½ãƒ«ã®ã‚¢ã‚¯ãƒ†ã‚£ãƒ–çŠ¶æ…‹ã‚’å¤‰æ›´ã§ãã‚‹ã‚³ãƒžãƒ³ãƒ‰ã‚’è¿½åŠ&nbsp;
//                   ã‚¢ã‚¤ãƒ†ãƒ&nbsp;è¡¨ç¤ºã®åˆ¶å¾¡æ–‡å­—ã§ã‚¢ã‚¤ã‚³ãƒ³è¡¨ç¤ºå¯å¦ã‚’å¤‰æ›´ã§ãã‚‹è¨­å®šã‚’è¿½åŠ&nbsp;
// 1.14.0 2019/01/13 èƒŒæ™¯ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã«ã‚«ãƒ¼ã‚½ãƒ«è¡¨ç¤ºã§ãã‚‹æ©Ÿèƒ½ã‚’è¿½åŠ&nbsp;
// 1.13.0 2018/11/25 èƒŒæ™¯è‰²ã®ã‚°ãƒ©ãƒ‡ãƒ¼ã‚·ãƒ§ãƒ³ã‚’è¨­å®šã§ãã‚‹æ©Ÿèƒ½ã‚’è¿½åŠ&nbsp;
// 1.12.0 2018/11/08 èƒŒæ™¯ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã®é€æ˜Žåº¦ã¨æ–‡å­—åˆ—ãƒ”ã‚¯ãƒãƒ£ã®é€æ˜Žåº¦ã‚’é€£å‹•ã•ã›ã‚‹ã‚ˆã†ä»•æ§˜å¤‰æ›´
// 1.11.1 2018/10/20 ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ç­‰ã§Game_Variables.prototype.setValueã‚’å‘¼ã‚“ã&nbsp;ã¨ãã€å¤‰æ•°ã®æ·»ãˆå­—ã«æ–‡å­—åˆ—åž‹ã®æ•°å€¤ã‚’æ¸¡ã—ãŸå&nbsp;´åˆã‚‚å¤‰æ•°ã®ãƒªã‚¢ãƒ«ã‚¿ã‚¤ãƒ&nbsp;è¡¨ç¤ºãŒåŠ¹ãã‚ˆã†ä¿®æ­£
// 1.11.0 2018/10/13 å…¬å¼ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ã€ŒTextDecoration.jsã€ã®è¨­å®šã‚’å‹•çš„æ–‡å­—åˆ—ã«é©ç”¨ã§ãã‚‹æ©Ÿèƒ½ã‚’è¿½åŠ&nbsp;
// 1.10.1 2018/05/30 ã‚¢ã‚¦ãƒˆãƒ©ã‚¤ãƒ³ã‚«ãƒ©ãƒ¼å–å¾—ã§0ãŠã‚ˆã³ãã®ä»–ã®æ–‡å­—åˆ—ã‚’æŒ‡å®šã—ãŸã¨ãã«æ­£ã—ãè‰²ãŒè¨­å®šã•ã‚Œãªã„å•é¡Œã‚’ä¿®æ­£(byå¥ã­ã“ã¾ã•ã‚“)
// 1.10.0 2017/02/12 ã‚¢ã‚¦ãƒˆãƒ©ã‚¤ãƒ³ã‚«ãƒ©ãƒ¼ã‚’ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚«ãƒ©ãƒ¼ç•ªå·ã‹ã‚‰æŒ‡å®šã§ãã‚‹æ©Ÿèƒ½ã‚’è¿½åŠ&nbsp;
// 1.9.0 2017/08/20 ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã¤ããƒ”ã‚¯ãƒãƒ£ãŒé‡ãªã£ãŸã¨ãã«ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ãŒãƒ”ã‚¯ãƒãƒ£ã®ä¸‹ã«è¡¨ç¤ºã•ã‚Œã‚‹å•é¡Œã‚’ä¿®æ­£
// 1.8.6 2017/06/28 ãƒ•ã‚©ãƒ³ãƒˆå¤‰æ›´æ©Ÿèƒ½ã®ãƒ˜ãƒ«ãƒ—ãŒæŠœã‘ã¦ã„ãŸã®ã§è¿½åŠ&nbsp;
// 1.8.5 2017/06/12 å¤‰æ•°ãŒãƒžã‚¤ãƒŠã‚¹å€¤ã®ã¨ãã®ã‚¼ãƒ­åŸ‹ã‚è¡¨ç¤ºãŒæ­£ã—ãè¡¨ç¤ºã•ã‚Œãªã„å•é¡Œã‚’ä¿®æ­£
// 1.8.4 2017/05/10 ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ã‚’æœªé©ç”¨ã®ãƒ‡ãƒ¼ã‚¿ã‚’èª­ã¿è¾¼ã‚“ã&nbsp;ã¨ãã€æœ€åˆã®ä¸€å›žã®ã¿å‹•çš„æ–‡å­—åˆ—ãƒ”ã‚¯ãƒãƒ£ãŒä½œæˆã•ã‚Œãªã„å•é¡Œã‚’ä¿®æ­£
// 1.8.3 2017/04/19 è‡ªå‹•ç¿»è¨³ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ã«ä¸€éƒ¨å¯¾å¿œ
// 1.8.2 2017/04/05 ãƒ”ã‚¯ãƒãƒ£ã®æ¶ˆåŽ»æ™‚ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¦ã„ãŸå•é¡Œã‚’ä¿®æ­£
// 1.8.1 2017/03/30 æ‹¡å¤§çŽ‡ã¨åŽŸç‚¹ã«å¯¾å¿œã—ã¦ã„ãªã‹ã£ãŸå•é¡Œã‚’ä¿®æ­£
// 1.8.0 2017/03/30 èƒŒæ™¯ã«ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’è¡¨ç¤ºã§ãã‚‹æ©Ÿèƒ½ã‚’è¿½åŠ&nbsp;
// 1.7.1 2017/03/20 1.7.0ã§æœ«å°¾ãŒã‚¤ã‚¿ãƒªãƒƒã‚¯ä½“ã®å&nbsp;´åˆã«ã€å‚¾ãéƒ¨åˆ†ãŒè¦‹åˆ‡ã‚Œã¦ã—ã¾ã†å•é¡Œã‚’ä¿®æ­£
// 1.7.0 2017/03/20 å‹•çš„æ–‡å­—åˆ—ã‚’å¤ªå­—ã¨ã‚¤ã‚¿ãƒªãƒƒã‚¯ã«ã§ãã‚‹æ©Ÿèƒ½ã‚’è¿½åŠ&nbsp;
//                  è¤‡æ•°è¡Œè¡¨ç¤ºã‹ã¤åˆ¶å¾¡æ–‡å­—ã§ã‚¢ã‚¤ã‚³ãƒ³ã‚’æŒ‡å®šã—ãŸå&nbsp;´åˆã«é«˜ã•ãŒä½™åˆ†ã«è¨ˆç®—ã•ã‚Œã¦ã—ã¾ã†å•é¡Œã®ä¿®æ­£
// 1.6.2 2016/12/13 å‹•çš„ãƒ”ã‚¯ãƒãƒ£ã«å¯¾ã—ã¦ã€ãƒ”ã‚¯ãƒãƒ£ã®è¡¨ç¤ºã¨ãƒ”ã‚¯ãƒãƒ£ã®è‰²èª¿å¤‰æ›´ã‚’åŒãƒ•ãƒ¬ãƒ¼ãƒ&nbsp;ã§è¡Œã†ã¨ç”»åƒãŒæ¶ˆãˆã‚‹å•é¡Œã®ä¿®æ­£
// 1.6.1 2016/11/03 ä¸€é€šã‚Šã®ç«¶åˆå¯¾ç­–
// 1.6.0 2016/11/03 ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•ã‚Œã¦ã„ã‚‹ãƒ•ã‚©ãƒ³ãƒˆã‚’ãƒ”ã‚¯ãƒãƒ£ã®ãƒ•ã‚©ãƒ³ãƒˆã¨ã—ã¦åˆ©ç”¨ã§ãã‚‹æ©Ÿèƒ½ã‚’è¿½åŠ&nbsp;
// 1.5.1 2016/10/27 1.5.0ã§ã‚¢ã‚¦ãƒˆãƒ©ã‚¤ãƒ³ã‚«ãƒ©ãƒ¼ã‚’æŒ‡å®šã™ã‚‹ã¨ã‚¨ãƒ©ãƒ¼ã«ãªã£ã¦ã„ãŸç¾è±¡ã‚’ä¿®æ­£
// 1.5.0 2016/10/23 åˆ¶å¾¡æ–‡å­—ã§è¡¨ç¤ºã—ãŸå¤‰æ•°ã®å†…å®¹ã‚’ãƒªã‚¢ãƒ«ã‚¿ã‚¤ãƒ&nbsp;æ›´æ–°ã§ãã‚‹æ©Ÿèƒ½ã‚’è¿½åŠ&nbsp;
// 1.4.2 2016/07/02 ã‚¹ã‚¯ãƒªãƒ—ãƒˆã‹ã‚‰ãƒ€ã‚¤ãƒ¬ã‚¯ãƒˆã§å®Ÿè¡Œã—ãŸå&nbsp;´åˆã‚‚åˆ¶å¾¡æ–‡å­—ãŒåæ˜&nbsp;ã•ã‚Œã‚‹ã‚ˆã†ä¿®æ­£ï¼ˆãŸã&nbsp;ã—ä½™åˆ†ã«ã‚¨ã‚¹ã‚±ãƒ¼ãƒ—ã™ã‚‹å¿…è¦ã‚ã‚Šï¼‰
// 1.4.1 2016/06/29 åˆ¶å¾¡æ–‡å­—ã€Œ\{ã€ã§æ–‡å­—ã‚µã‚¤ã‚ºã‚’å¤§ããã—ãŸéš›ã€å…ƒã®ã‚µã‚¤ã‚ºã«æˆ»ã•ãªã„ã¨æ­£ã—ã„ã‚µã‚¤ã‚ºã§è¡¨ç¤ºã•ã‚Œãªã„å•é¡Œã‚’ä¿®æ­£
// 1.4.0 2016/06/28 D_TEXTå®Ÿè¡Œå¾Œã«ç”»åƒã‚’æŒ‡å®šã—ã¦ãƒ”ã‚¯ãƒãƒ£ã‚’è¡¨ç¤ºã—ãŸå&nbsp;´åˆã¯ç”»åƒã‚’å„ªå…ˆè¡¨ç¤ºã™ã‚‹ã‚ˆã†ä»•æ§˜å¤‰æ›´
// 1.3.1 2016/06/07 æç”»æ–‡å­—ãŒåŠè§’è‹±æ•°å­—ã®ã¿ã‹ã¤ãƒ•ã‚©ãƒ³ãƒˆã‚’æœªæŒ‡å®šã®å&nbsp;´åˆã«æ–‡å­—ãŒæç”»ã•ã‚Œãªã„ä¸å…·åˆã‚’ä¿®æ­£
// 1.3.0 2016/06/03 åˆ¶å¾¡æ–‡å­—\oc[c] \ow[n]ã«å¯¾å¿œ
// 1.2.2 2016/03/28 ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹æƒ…å&nbsp;±ã‚’ç°¡å˜ã«å‡ºåŠ›ã™ã‚‹åˆ¶å¾¡æ–‡å­—ã‚’è¿½åŠ&nbsp;
// 1.2.1 2016/01/29 ã‚³ãƒžãƒ³ãƒ‰ã€ŒD_TEXT_SETTINGã€ã®å®Ÿè£…ãŒã€ŒD_TEST_SETTINGã€ã«ãªã£ã¦ã„ãŸã®ã§ä¿®æ­£ï¼ˆç¬‘ï¼‰
// 1.2.0 2016/01/27 è¤‡æ•°è¡Œè¡¨ç¤ºã«å¯¾å¿œ
//                  æ–‡å­—åˆ—ã®æƒãˆã¨èƒŒæ™¯è‰²ã‚’è¨­å®šã™ã‚‹æ©Ÿèƒ½ã‚’è¿½åŠ&nbsp;
//                  å¤‰æ•°ã‚’ã‚¼ãƒ­åŸ‹ã‚ã—ã¦è¡¨ç¤ºã™ã‚‹æ©Ÿèƒ½ã‚’è¿½åŠ&nbsp;
// 1.1.3 2015/12/10 æˆ¦é—˜ç”»é¢ã§ã‚‚ãƒ”ã‚¯ãƒãƒ£ã‚’ä½¿ç”¨ã§ãã‚‹ã‚ˆã†ä¿®æ­£
//                  æç”»å¾Œã«ãƒ‡ãƒãƒƒã‚°ç”»é¢ç­‰ã‚’é–‹ã„ã¦å¤‰æ•°ã‚’ä¿®æ­£ã—ãŸå&nbsp;´åˆã€å†æç”»ã§å¤‰æ›´ãŒåæ˜&nbsp;ã•ã‚Œã¦ã—ã¾ã†å•é¡Œã‚’ä¿®æ­£
// 1.1.2 2015/11/07 æç”»æ–‡å­—åˆ—ã«åŠè§’ã‚¹ãƒšãƒ¼ã‚¹ãŒå«ã¾ã‚Œã¦ã„ãŸå&nbsp;´åˆã‚‚å•é¡Œãªãå®Ÿè¡Œã§ãã‚‹ã‚ˆã†ä¿®æ­£
// 1.1.0 2015/11/07 åˆ¶å¾¡æ–‡å­—\C[n] \I[n] \{ \} ã«å¯¾å¿œï¼ˆ\$ã¨è¡¨ç¤ºã‚¹ãƒ”ãƒ¼ãƒ‰åˆ¶å¾¡ç³»ä»¥å¤–å…¨éƒ¨ï¼‰
// 1.0.1 2015/11/07 RPGãƒ„ã‚¯ãƒ¼ãƒ«MVï¼ˆæ—¥æœ¬èªžç‰ˆï¼‰ã«åˆã‚ã›ã¦ã‚³ãƒ¡ãƒ³ãƒˆã®è¡¨è¨˜ã‚’å¤‰æ›´
// 1.0.0 2015/11/06 åˆç‰ˆ
// ----------------------------------------------------------------------------
// [Blog]   : https://triacontane.blogspot.jp/
// [Twitter]: https://twitter.com/triacontane/
// [GitHub] : https://github.com/triacontane/
//=============================================================================

/*:
 * @plugindesc å‹•çš„æ–‡å­—åˆ—ãƒ”ã‚¯ãƒãƒ£ç”Ÿæˆãƒ—ãƒ©ã‚°ã‚¤ãƒ³
 * @author ãƒˆãƒªã‚¢ã‚³ãƒ³ã‚¿ãƒ³
 *
 * @param itemIconSwitchId
 * @text ã‚¢ã‚¤ãƒ†ãƒ&nbsp;ã‚¢ã‚¤ã‚³ãƒ³ã‚¹ã‚¤ãƒƒãƒID
 * @desc æŒ‡å®šã—ãŸç•ªå·ã®ã‚¹ã‚¤ãƒƒãƒãŒONã®ã¨ã\ITEM[n]ã§ã‚¢ã‚¤ã‚³ãƒ³ãŒè¡¨ç¤ºã•ã‚Œã¾ã™ã€‚æŒ‡å®šã—ãªã„å&nbsp;´åˆã€å¸¸ã«è¡¨ç¤ºã•ã‚Œã¾ã™ã€‚
 * @default 0
 * @type switch
 *
 * @param lineSpacingVariableId
 * @text è¡Œé–“è£œæ­£å¤‰æ•°ID
 * @desc è¤‡æ•°è¡Œè¡¨ç¤ºã®éš›ã®è¡Œé–“ã«ã€æŒ‡å®šã—ãŸå¤‰æ•°ã®å€¤ã®åˆ†ã&nbsp;ã‘è£œæ­£ãŒæŽ›ã‹ã‚Šã¾ã™ã€‚å¤§ãã™ãŽã‚‹å€¤ã‚’è¨­å®šã™ã‚‹ã¨è¦‹åˆ‡ã‚Œã‚‹å&nbsp;´åˆãŒã‚ã‚Šã¾ã™ã€‚
 * @default 0
 * @type variable
 *
 * @param frameWindowSkin
 * @text ãƒ•ãƒ¬ãƒ¼ãƒ&nbsp;ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚¹ã‚­ãƒ³
 * @desc ãƒ•ãƒ¬ãƒ¼ãƒ&nbsp;ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã®ã‚¹ã‚­ãƒ³ãƒ•ã‚¡ã‚¤ãƒ«åã§ã™ã€‚ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ãƒ“ãƒ«ãƒ€ãƒ¼ã‚’ä½¿ã£ã¦ã„ã‚‹å&nbsp;´åˆã¯ã€æŒ‡å®šã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚
 * @default
 * @require 1
 * @dir img/system/
 * @type file
 *
 * @param frameWindowPadding
 * @text ãƒ•ãƒ¬ãƒ¼ãƒ&nbsp;ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ä½™ç™½
 * @desc ãƒ•ãƒ¬ãƒ¼ãƒ&nbsp;ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã®ä½™ç™½ã§ã™ã€‚
 * @default 18
 * @type number
 *
 * @param padCharacter
 * @text åŸ‹ã‚æ–‡å­—
 * @desc æ•°å€¤æç”»æ™‚ã€æŒ‡å®šæ¡æ•°ã«æº€ãŸãªã„ã¨ãã«åŸ‹ã‚ã‚‰ã‚Œã‚‹æ–‡å­—ã§ã™ã€‚åŠè§’ã§1æ–‡å­—ã&nbsp;ã‘æŒ‡å®šã—ã¦ãã&nbsp;ã•ã„ã€‚
 * @default 0
 *
 * @param prefixText
 * @text æŽ¥é&nbsp;­è¾žæ–‡å­—åˆ—
 * @desc ã™ã¹ã¦ã®æ–‡å­—åˆ—ãƒ”ã‚¯ãƒãƒ£ã®å‰ã«æŒ¿å…¥ã•ã‚Œã‚‹ãƒ†ã‚­ã‚¹ãƒˆã§ã™ã€‚ä¸»ã«ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã®åˆ¶å¾¡æ–‡å­—ãªã©ã‚’æŒ‡å®šã—ã¾ã™ã€‚
 * @default
 *
 * @help æŒ‡å®šã—ãŸæ–‡å­—åˆ—ã§ãƒ”ã‚¯ãƒãƒ£ã‚’å‹•çš„ã«ç”Ÿæˆã™ã‚‹ã‚³ãƒžãƒ³ãƒ‰ã‚’æä¾›ã—ã¾ã™ã€‚
 * æ–‡å­—åˆ—ã«ã¯å„ç¨®åˆ¶å¾¡æ–‡å­—ï¼ˆ\v[n]ç­‰ï¼‰ã‚‚ä½¿ç”¨å¯èƒ½ã§ã€åˆ¶å¾¡æ–‡å­—ã§è¡¨ç¤ºã—ãŸå¤‰æ•°ã®å€¤ãŒ
 * å¤‰æ›´ã•ã‚ŒãŸã¨ãã«ãƒªã‚¢ãƒ«ã‚¿ã‚¤ãƒ&nbsp;ã§ãƒ”ã‚¯ãƒãƒ£ã®å†…å®¹ã‚’æ›´æ–°ã§ãã¾ã™ã€‚
 *
 * ä»¥ä¸‹ã®æ‰‹é&nbsp;†ã§è¡¨ç¤ºã—ã¾ã™ã€‚
 *  1 : ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ã‚³ãƒžãƒ³ãƒ‰[D_TEXT]ã§æç”»ã—ãŸã„æ–‡å­—åˆ—ã¨å¼•æ•°ã‚’æŒ‡å®šï¼ˆä¸‹è¨˜ã®ä¾‹å‚ç…§ï¼‰
 *  2 : ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ã‚³ãƒžãƒ³ãƒ‰[D_TEXT_SETTING]ã§èƒŒæ™¯è‰²ã‚„æƒãˆã‚’æŒ‡å®šï¼ˆä»»æ„ï¼‰
 *  3 : ã‚¤ãƒ™ãƒ³ãƒˆã‚³ãƒžãƒ³ãƒ‰ã€Œãƒ”ã‚¯ãƒãƒ£ã®è¡¨ç¤ºã€ã§ã€Œç”»åƒã€ã‚’æœªé¸æŠžã«æŒ‡å®šã€‚
 * â€» 1ã®æ™‚ç‚¹ã§ã¯ãƒ”ã‚¯ãƒãƒ£ã¯è¡¨ç¤ºã•ã‚Œãªã„ã®ã§å¿…ãšã‚»ãƒƒãƒˆã§å‘¼ã³å‡ºã—ã¦ãã&nbsp;ã•ã„ã€‚
 * â€» ãƒ”ã‚¯ãƒãƒ£è¡¨ç¤ºå‰ã«D_TEXTã‚’è¤‡æ•°å›žå®Ÿè¡Œã™ã‚‹ã¨ã€è¤‡æ•°è¡Œè¡¨ç¤ºã§ãã¾ã™ã€‚
 *
 * â€» ver1.4.0ã‚ˆã‚Šã€[D_TEXT]å®Ÿè¡Œå¾Œã«ã€Œãƒ”ã‚¯ãƒãƒ£ã®è¡¨ç¤ºã€ã§ã€Œç”»åƒã€ã‚’æŒ‡å®šã—ãŸå&nbsp;´åˆã¯
 *    å‹•çš„æ–‡å­—åˆ—ãƒ”ã‚¯ãƒãƒ£ç”Ÿæˆã‚’ä¿ç•™ã¨ã—ã¦é€šå¸¸é€šã‚Šã€Œç”»åƒã€ãƒ”ã‚¯ãƒãƒ£ãŒè¡¨ç¤ºã•ã‚Œã‚‹
 *    ã‚ˆã†ã«æŒ™å‹•ãŒå¤‰æ›´ã«ãªã‚Šã¾ã—ãŸã€‚
 *
 * ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ã‚³ãƒžãƒ³ãƒ‰è©³ç´°
 *   ã‚¤ãƒ™ãƒ³ãƒˆã‚³ãƒžãƒ³ãƒ‰ã€Œãƒ—ãƒ©ã‚°ã‚¤ãƒ³ã‚³ãƒžãƒ³ãƒ‰ã€ã‹ã‚‰å®Ÿè¡Œã€‚
 *   ï¼ˆå¼•æ•°ã®é–“ã¯åŠè§’ã‚¹ãƒšãƒ¼ã‚¹ã§åŒºåˆ‡ã‚‹ï¼‰
 *
 *  D_TEXT [æç”»æ–‡å­—åˆ—] [æ–‡å­—ã‚µã‚¤ã‚º] : å‹•çš„æ–‡å­—åˆ—ãƒ”ã‚¯ãƒãƒ£ç”Ÿæˆã®æº–å‚™
 *  ä¾‹ï¼šD_TEXT ãƒ†ã‚¹ãƒˆæ–‡å­—åˆ— 32
 *
 * è¡¨ç¤ºå¾Œã¯é€šå¸¸ã®ãƒ”ã‚¯ãƒãƒ£ã¨åŒæ§˜ã«ç§»å‹•ã‚„å›žè»¢ã€æ¶ˆåŽ»ãŒã§ãã¾ã™ã€‚
 * ã¾ãŸã€å¤‰æ•°ã‚„ã‚¢ã‚¯ã‚¿ãƒ¼ã®è¡¨ç¤ºãªã©åˆ¶å¾¡æ–‡å­—ã«ã‚‚å¯¾å¿œã—ã¦ã„ã¾ã™ã€‚
 *
 *  D_TEXT_SETTING ALIGN [æƒãˆ] : æƒãˆï¼ˆå·¦æƒãˆã€ä¸­å¤®æƒãˆã€å³æƒãˆï¼‰ã®è¨­å®š
 *  0:å·¦æƒãˆ 1:ä¸­å¤®æƒãˆ 2:å³æƒãˆ
 *
 *  ä¾‹ï¼šD_TEXT_SETTING ALIGN 0
 *      D_TEXT_SETTING ALIGN CENTER
 *
 * â€» æƒãˆã®è¨­å®šã¯è¤‡æ•°è¡Œã‚’æŒ‡å®šã—ãŸã¨ãã«æœ€ã‚‚æ¨ªå¹…ã®å¤§ãã„è¡Œã«åˆã‚ã›ã‚‰ã‚Œã¾ã™ã€‚
 * ã€€ ã‚ˆã£ã¦å˜ä¸€è¡Œã—ã‹æç”»ã—ãªã„ã¨ãã¯ã€ã“ã®è¨­å®šã¯æ©Ÿèƒ½ã—ã¾ã›ã‚“ã€‚
 *
 *  D_TEXT_SETTING BG_COLOR [èƒŒæ™¯è‰²] : èƒŒæ™¯è‰²ã®è¨­å®š(CSSã®è‰²æŒ‡å®šã¨åŒæ§˜ã®æ›¸å¼)
 *
 *  ä¾‹ï¼šD_TEXT_SETTING BG_COLOR black
 *      D_TEXT_SETTING BG_COLOR #336699
 *      D_TEXT_SETTING BG_COLOR rgba(255,255,255,0.5)
 *
 *  èƒŒæ™¯è‰²ã®ã‚°ãƒ©ãƒ‡ãƒ¼ã‚·ãƒ§ãƒ³ã‚’ãƒ”ã‚¯ã‚»ãƒ«æ•°ã§æŒ‡å®šã§ãã¾ã™ã€‚
 *  D_TEXT_SETTING BG_GRADATION_RIGHT [ãƒ”ã‚¯ã‚»ãƒ«æ•°]
 *  D_TEXT_SETTING BG_GRADATION_LEFT [ãƒ”ã‚¯ã‚»ãƒ«æ•°]
 *
 *  ä¾‹ï¼šD_TEXT_SETTING BG_GRADATION_RIGHT 50
 *  ã€€ã€€D_TEXT_SETTING BG_GRADATION_LEFT 50
 *
 *  D_TEXT_SETTING REAL_TIME ON : åˆ¶å¾¡æ–‡å­—ã§è¡¨ç¤ºã—ãŸå¤‰æ•°ã®ãƒªã‚¢ãƒ«ã‚¿ã‚¤ãƒ&nbsp;è¡¨ç¤º
 *
 *  ä¾‹ï¼šD_TEXT_SETTING REAL_TIME ON
 *
 *  ãƒªã‚¢ãƒ«ã‚¿ã‚¤ãƒ&nbsp;è¡¨ç¤ºã‚’æœ‰åŠ¹ã«ã—ã¦ãŠãã¨ã€ãƒ”ã‚¯ãƒãƒ£ã®è¡¨ç¤ºå¾Œã«å¤‰æ•°ã®å€¤ãŒå¤‰åŒ–ã—ãŸã¨ã
 *  è‡ªå‹•ã§ãƒ”ã‚¯ãƒãƒ£ã®å†…å®¹ã‚‚æ›´æ–°ã•ã‚Œã¾ã™ã€‚
 *
 *  D_TEXT_SETTING WINDOW ON : èƒŒæ™¯ã«ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’è¡¨ç¤ºã™ã‚‹
 *  ä¾‹ï¼šD_TEXT_SETTING WINDOW ON
 *
 *  D_TEXT_SETTING FONT [ãƒ•ã‚©ãƒ³ãƒˆå] : æç”»ã§ä½¿ç”¨ã™ã‚‹ãƒ•ã‚©ãƒ³ãƒˆã‚’æŒ‡å®šã—ãŸåç§°ã«å¤‰æ›´
 *  ä¾‹ï¼šD_TEXT_SETTING FONT ï¼­ï¼³ ï¼°æ˜Žæœ
 *
 * ã“ã‚Œã‚‰ã®è¨­å®šã¯D_TEXTã¨åŒæ§˜ã€ãƒ”ã‚¯ãƒãƒ£ã‚’è¡¨ç¤ºã™ã‚‹å‰ã«è¡Œã£ã¦ãã&nbsp;ã•ã„ã€‚
 *
 * å¯¾å¿œåˆ¶å¾¡æ–‡å­—ä¸€è¦§ï¼ˆã‚¤ãƒ™ãƒ³ãƒˆã‚³ãƒžãƒ³ãƒ‰ã€Œæ–‡ç«&nbsp;ã®è¡¨ç¤ºã€ã¨åŒä¸€ã§ã™ï¼‰
 * \V[n]
 * \N[n]
 * \P[n]
 * \G
 * \C[n]
 * \I[n]
 * \{
 * \}
 *
 * å°‚ç”¨åˆ¶å¾¡æ–‡å­—
 * \V[n,m](mæ¡åˆ†ã®ãƒ‘ãƒ©ãƒ¡ãƒ¼ã‚¿ã§æŒ‡å®šã—ãŸæ–‡å­—ã§åŸ‹ã‚ãŸå¤‰æ•°ã®å€¤)
 * \item[n]   n ç•ªã®ã‚¢ã‚¤ãƒ†ãƒ&nbsp;æƒ…å&nbsp;±ï¼ˆã‚¢ã‚¤ã‚³ãƒ³ï¼‹åç§°ï¼‰
 * \weapon[n] n ç•ªã®æ­¦å™¨æƒ…å&nbsp;±ï¼ˆã‚¢ã‚¤ã‚³ãƒ³ï¼‹åç§°ï¼‰
 * \armor[n]  n ç•ªã®é˜²å…·æƒ…å&nbsp;±ï¼ˆã‚¢ã‚¤ã‚³ãƒ³ï¼‹åç§°ï¼‰
 * \skill[n]  n ç•ªã®ã‚¹ã‚­ãƒ«æƒ…å&nbsp;±ï¼ˆã‚¢ã‚¤ã‚³ãƒ³ï¼‹åç§°ï¼‰
 * \state[n]  n ç•ªã®ã‚¹ãƒ†ãƒ¼ãƒˆæƒ…å&nbsp;±ï¼ˆã‚¢ã‚¤ã‚³ãƒ³ï¼‹åç§°ï¼‰
 * \oc[c] ã‚¢ã‚¦ãƒˆãƒ©ã‚¤ãƒ³ã‚«ãƒ©ãƒ¼ã‚’ã€Œcã€ã«è¨­å®š(â€»1)
 * \ow[n] ã‚¢ã‚¦ãƒˆãƒ©ã‚¤ãƒ³å¹…ã‚’ã€Œnã€ã«è¨­å®š(ä¾‹:\ow[5])
 * \f[b] ãƒ•ã‚©ãƒ³ãƒˆã®å¤ªå­—åŒ–
 * \f[i] ãƒ•ã‚©ãƒ³ãƒˆã®ã‚¤ã‚¿ãƒªãƒƒã‚¯åŒ–
 * \f[n] ãƒ•ã‚©ãƒ³ãƒˆã®å¤ªå­—ã¨ã‚¤ã‚¿ãƒªãƒƒã‚¯ã‚’é€šå¸¸ã«æˆ»ã™
 *
 * â€»1 ã‚¢ã‚¦ãƒˆãƒ©ã‚¤ãƒ³ã‚«ãƒ©ãƒ¼ã®æŒ‡å®šæ–¹æ³•
 * \oc[red]  è‰²åã§æŒ‡å®š
 * \oc[rgb(0,255,0)] ã‚«ãƒ©ãƒ¼ã‚³ãƒ¼ãƒ‰ã§æŒ‡å®š
 * \oc[2] æ–‡å­—è‰²ç•ªå·\c[n]ã¨åŒæ§˜ã®ã‚‚ã®ã§æŒ‡å®š
 *
 * èƒŒæ™¯ã«ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’è¡¨ç¤ºã—ã¦ã„ã‚‹ã¨ãã«ã‚«ãƒ¼ã‚½ãƒ«ã‚’è¡¨ç¤ºã—ã¾ã™ã€‚
 * ã“ã®ã‚³ãƒžãƒ³ãƒ‰ã¯å‹•çš„æ–‡å­—åˆ—ãƒ”ã‚¯ãƒãƒ£ã‚’è¡¨ç¤ºå¾Œã«å®Ÿè¡Œã—ã¦ãã&nbsp;ã•ã„ã€‚
 *  D_TEXT_WINDOW_CURSOR 1 ON  # ãƒ”ã‚¯ãƒãƒ£[1]ã«ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚«ãƒ¼ã‚½ãƒ«ã‚’è¡¨ç¤º
 *  D_TEXT_WINDOW_CURSOR 2 OFF # ãƒ”ã‚¯ãƒãƒ£[2]ã«ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚«ãƒ¼ã‚½ãƒ«ã‚’æ¶ˆåŽ»
 *
 * ã‚«ãƒ¼ã‚½ãƒ«ã®ã‚¢ã‚¯ãƒ†ã‚£ãƒ–çŠ¶æ…‹ã‚’å¤‰æ›´ã™ã‚‹ã‚³ãƒžãƒ³ãƒ‰ã¯ä»¥ä¸‹ã®é€šã‚Šã§ã™ã€‚
 *  D_TEXT_WINDOW_CURSOR_ACTIVE 2 ON  # ãƒ”ã‚¯ãƒãƒ£[1]ã®ã‚«ãƒ¼ã‚½ãƒ«ã‚’ã‚¢ã‚¯ãƒ†ã‚£ãƒ–
 *  D_TEXT_WINDOW_CURSOR_ACTIVE 1 OFF # ãƒ”ã‚¯ãƒãƒ£[1]ã®ã‚«ãƒ¼ã‚½ãƒ«ã‚’ã‚¹ãƒˆãƒƒãƒ—
 *
 * ã‚«ãƒ¼ã‚½ãƒ«çŸ©å½¢ã®åº§æ¨™ã‚’æŒ‡å®šã™ã‚‹å&nbsp;´åˆã¯ä»¥ä¸‹ã®é€šã‚Šã§ã™ã€‚
 *  D_TEXT_WINDOW_CURSOR 1 ON 0 0 100 100  # ãƒ”ã‚¯ãƒãƒ£[1]ã«[0,0,100,100]ã®ã‚µã‚¤ã‚ºã®
 *                                         # ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚«ãƒ¼ã‚½ãƒ«ã‚’è¡¨ç¤º
 *
 * åˆ©ç”¨è¦ç´„ï¼š
 *  ä½œè€…ã«ç„¡æ–­ã§æ”¹å¤‰ã€å†é…å¸ƒãŒå¯èƒ½ã§ã€åˆ©ç”¨å½¢æ…‹ï¼ˆå•†ç”¨ã€18ç¦åˆ©ç”¨ç­‰ï¼‰
 *  ã«ã¤ã„ã¦ã‚‚åˆ¶é™ã¯ã‚ã‚Šã¾ã›ã‚“ã€‚
 *  ã“ã®ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ã¯ã‚‚ã†ã‚ãªãŸã®ã‚‚ã®ã§ã™ã€‚
 */
(function() {
    'use strict';

    var getCommandName = function(command) {
        return (command || '').toUpperCase();
    };

    var getArgNumber = function(arg, min, max) {
        if (arguments.length &lt; 2) min = -Infinity;
        if (arguments.length &lt; 3) max = Infinity;
        return (parseInt(convertEscapeCharacters(arg.toString())) || 0).clamp(min, max);
    };

    var getArgString = function(arg, upperFlg) {
        arg = convertEscapeCharacters(arg);
        return upperFlg ? arg.toUpperCase() : arg;
    };

    var getArgBoolean = function(arg) {
        return (arg || '').toUpperCase() === 'ON';
    };

    var connectArgs = function(args, startIndex, endIndex) {
        if (arguments.length &lt; 2) startIndex = 0;
        if (arguments.length &lt; 3) endIndex = args.length;
        var text = '';
        for (var i = startIndex; i &lt; endIndex; i++) {
            text += args[i];
            if (i &lt; endIndex - 1) text += ' ';
        }
        return text;
    };

    var convertEscapeCharacters = function(text) {
        if (text === undefined || text === null) text = '';
        var window = SceneManager.getHiddenWindow();
        return window ? window.convertEscapeCharacters(text) : text;
    };

    var getUsingVariables = function(text) {
        var usingVariables = [];

        text = text.replace(/\\/g, '\x1b');
        text = text.replace(/\x1b\x1b/g, '\\');
        text = text.replace(/\x1bV\[(\d+),\s*(\d+)]/gi, function() {
            var number = parseInt(arguments[1], 10);
            usingVariables.push(number);
            return $gameVariables.value(number);
        }.bind(this));
        text = text.replace(/\x1bV\[(\d+)]/gi, function() {
            var number = parseInt(arguments[1], 10);
            usingVariables.push(number);
            return $gameVariables.value(number);
        }.bind(this));
        text = text.replace(/\x1bV\[(\d+)]/gi, function() {
            var number = parseInt(arguments[1], 10);
            usingVariables.push(number);
            return $gameVariables.value(number);
        }.bind(this));
        return usingVariables;
    };

    /**
     * Create plugin parameter. param[paramName] ex. param.commandPrefix
     * @param pluginName plugin name(EncounterSwitchConditions)
     * @returns {Object} Created parameter
     */
    var createPluginParameter = function(pluginName) {
        var paramReplacer = function(key, value) {
            if (value === 'null') {
                return value;
            }
            if (value[0] === '"' &amp;&amp; value[value.length - 1] === '"') {
                return value;
            }
            try {
                return JSON.parse(value);
            } catch (e) {
                return value;
            }
        };
        var parameter     = JSON.parse(JSON.stringify(PluginManager.parameters(pluginName), paramReplacer));
        PluginManager.setParameters(pluginName, parameter);
        return parameter;
    };
    var textDecParam          = createPluginParameter('TextDecoration');
    var param                 = createPluginParameter('DTextPicture');

    //=============================================================================
    // Game_Interpreter
    //  ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ã‚³ãƒžãƒ³ãƒ‰[D_TEXT]ã‚’è¿½åŠ&nbsp;å®šç¾©ã—ã¾ã™ã€‚
    //=============================================================================
    var _Game_Interpreter_pluginCommand      = Game_Interpreter.prototype.pluginCommand;
    Game_Interpreter.prototype.pluginCommand = function(command, args) {
        _Game_Interpreter_pluginCommand.apply(this, arguments);
        this.pluginCommandDTextPicture(command, args);
    };

    // Resolve conflict for YEP_PluginCmdSwVar.js
    var _Game_Interpreter_processPluginCommandSwitchVariables = Game_Interpreter.prototype.processPluginCommandSwitchVariables;
    Game_Interpreter.prototype.processPluginCommandSwitchVariables = function() {
        if (this._params[0].toUpperCase().indexOf('D_TEXT') &gt;= 0) {
            return;
        }
        _Game_Interpreter_processPluginCommandSwitchVariables.apply(this, arguments);
    };

    Game_Interpreter.textAlignMapper = {
        LEFT: 0, CENTER: 1, RIGHT: 2, å·¦: 0, ä¸­å¤®: 1, å³: 2
    };

    Game_Interpreter.prototype.pluginCommandDTextPicture = function(command, args) {
        switch (getCommandName(command)) {
            case 'D_TEXT' :
                if (isNaN(args[args.length - 1]) || args.length === 1) args.push($gameScreen.dTextSize || 28);
                var fontSize = getArgNumber(args.pop());
                $gameScreen.setDTextPicture(connectArgs(args), fontSize);
                break;
            case 'D_TEXT_SETTING':
                switch (getCommandName(args[0])) {
                    case 'ALIGN' :
                        $gameScreen.dTextAlign = isNaN(args[1]) ?
                            Game_Interpreter.textAlignMapper[getArgString(args[1], true)] : getArgNumber(args[1], 0, 2);
                        break;
                    case 'BG_COLOR' :
                        $gameScreen.dTextBackColor = getArgString(connectArgs(args, 1));
                        break;
                    case 'BG_GRADATION_LEFT' :
                        $gameScreen.dTextGradationLeft = getArgNumber(args[1], 0);
                        break;
                    case 'BG_GRADATION_RIGHT' :
                        $gameScreen.dTextGradationRight = getArgNumber(args[1], 0);
                        break;
                    case 'FONT':
                        args.shift();
                        $gameScreen.setDtextFont(getArgString(connectArgs(args)));
                        break;
                    case 'REAL_TIME' :
                        $gameScreen.dTextRealTime = getArgBoolean(args[1]);
                        break;
                    case 'WINDOW':
                        $gameScreen.dWindowFrame = getArgBoolean(args[1]);
                        break;
                }
                break;
            case 'D_TEXT_WINDOW_CURSOR' :
                var windowRect = null;
                if (getArgBoolean(args[1])) {
                    windowRect = {
                        x     : getArgNumber(args[3] || '', 0),
                        y     : getArgNumber(args[4] || '', 0),
                        width : getArgNumber(args[5] || '', 0),
                        height: getArgNumber(args[6] || '', 0)
                    };
                }
                $gameScreen.setDTextWindowCursor(getArgNumber(args[0], 0), windowRect);
                break;
            case 'D_TEXT_WINDOW_CURSOR_ACTIVE' :
                $gameScreen.setDTextWindowCursorActive(getArgNumber(args[0], 0), getArgBoolean(args[1]));
                break;
        }
    };

    //=============================================================================
    // Game_Variables
    //  å€¤ã‚’å¤‰æ›´ã—ãŸå¤‰æ•°ã®å±¥æ­´ã‚’å–å¾—ã—ã¾ã™ã€‚
    //=============================================================================
    var _Game_Variables_setValue      = Game_Variables.prototype.setValue;
    Game_Variables.prototype.setValue = function(variableId, value) {
        variableId = parseInt(variableId);
        if (this.value(variableId) !== value) {
            this._changedVariables = this.getChangedVariables();
            if (!this._changedVariables.contains(variableId)) {
                this._changedVariables.push(variableId);
            }
        }
        _Game_Variables_setValue.apply(this, arguments);
    };

    Game_Variables.prototype.getChangedVariables = function() {
        return this._changedVariables || [];
    };

    Game_Variables.prototype.clearChangedVariables = function() {
        return this._changedVariables = [];
    };

    //=============================================================================
    // Game_Screen
    //  å‹•çš„ãƒ”ã‚¯ãƒãƒ£ç”¨ã®ãƒ—ãƒ­ãƒ‘ãƒ†ã‚£ã‚’è¿½åŠ&nbsp;å®šç¾©ã—ã¾ã™ã€‚
    //=============================================================================
    var _Game_Screen_clear      = Game_Screen.prototype.clear;
    Game_Screen.prototype.clear = function() {
        _Game_Screen_clear.call(this);
        this.clearDTextPicture();
    };

    Game_Screen.prototype.clearDTextPicture = function() {
        this.dTextValue          = null;
        this.dTextOriginal       = null;
        this.dTextRealTime       = null;
        this.dTextSize           = 0;
        this.dTextAlign          = 0;
        this.dTextBackColor      = null;
        this.dTextFont           = null;
        this.dUsingVariables     = null;
        this.dWindowFrame        = null;
        this.dTextGradationRight = 0;
        this.dTextGradationLeft  = 0;
    };

    Game_Screen.prototype.setDTextPicture = function(value, size) {
        if (typeof TranslationManager !== 'undefined') {
            TranslationManager.translateIfNeed(value, function(translatedText) {
                value = translatedText;
            });
        }
        this.dUsingVariables = (this.dUsingVariables || []).concat(getUsingVariables(value));
        this.dTextValue      = (this.dTextValue || '') + getArgString(value, false) + '\n';
        this.dTextOriginal   = (this.dTextOriginal || '') + value + '\n';
        this.dTextSize       = size;
    };

    Game_Screen.prototype.setDTextWindowCursor = function(pictureId, rect) {
        var picture = this.picture(pictureId);
        if (picture) {
            picture.setWindowCursor(rect);
            picture.setWindowCursorActive(true);
        }
    };

    Game_Screen.prototype.setDTextWindowCursorActive = function(pictureId, value) {
        var picture = this.picture(pictureId);
        if (picture) {
            picture.setWindowCursorActive(value);
        }
    };

    Game_Screen.prototype.getDTextPictureInfo = function() {
        var prefix = getArgString(param.prefixText) || '';
        return {
            value         : prefix + this.dTextValue,
            size          : this.dTextSize || 0,
            align         : this.dTextAlign || 0,
            color         : this.dTextBackColor,
            font          : this.dTextFont,
            usingVariables: this.dUsingVariables,
            realTime      : this.dTextRealTime,
            originalValue : prefix + this.dTextOriginal,
            windowFrame   : this.dWindowFrame,
            gradationLeft : this.dTextGradationLeft,
            gradationRight: this.dTextGradationRight,
        };
    };

    Game_Screen.prototype.isSettingDText = function() {
        return !!this.dTextValue;
    };

    Game_Screen.prototype.setDtextFont = function(name) {
        this.dTextFont = name;
    };

    var _Game_Screen_updatePictures      = Game_Screen.prototype.updatePictures;
    Game_Screen.prototype.updatePictures = function() {
        _Game_Screen_updatePictures.apply(this, arguments);
        $gameVariables.clearChangedVariables();
    };

    //=============================================================================
    // Game_Picture
    //  å‹•çš„ãƒ”ã‚¯ãƒãƒ£ç”¨ã®ãƒ—ãƒ­ãƒ‘ãƒ†ã‚£ã‚’è¿½åŠ&nbsp;å®šç¾©ã—ã€è¡¨ç¤ºå‡¦ç†ã‚’å‹•çš„ãƒ”ã‚¯ãƒãƒ£å¯¾å¿œã«å¤‰æ›´ã—ã¾ã™ã€‚
    //=============================================================================
    var _Game_Picture_initBasic      = Game_Picture.prototype.initBasic;
    Game_Picture.prototype.initBasic = function() {
        _Game_Picture_initBasic.call(this);
        this.dTextValue = null;
        this.dTextInfo  = null;
    };

    var _Game_Picture_show      = Game_Picture.prototype.show;
    Game_Picture.prototype.show = function(name, origin, x, y, scaleX,
                                           scaleY, opacity, blendMode) {
        if ($gameScreen.isSettingDText() &amp;&amp; !name) {
            arguments[0]   = Date.now().toString();
            this.dTextInfo = $gameScreen.getDTextPictureInfo();
            $gameScreen.clearDTextPicture();
        } else {
            this.dTextInfo = null;
        }
        _Game_Picture_show.apply(this, arguments);
    };

    var _Game_Picture_update      = Game_Picture.prototype.update;
    Game_Picture.prototype.update = function() {
        _Game_Picture_update.apply(this, arguments);
        if (this.dTextInfo &amp;&amp; this.dTextInfo.realTime) {
            this.updateDTextVariable();
        }
    };

    Game_Picture.prototype.updateDTextVariable = function() {
        $gameVariables.getChangedVariables().forEach(function(variableId) {
            if (this.dTextInfo.usingVariables.contains(variableId)) {
                this._name           = Date.now().toString();
                this.dTextInfo.value = getArgString(this.dTextInfo.originalValue, false);
            }
        }, this);
    };

    Game_Picture.prototype.setWindowCursor = function(rect) {
        this._windowCursor = rect;
    };

    Game_Picture.prototype.getWindowCursor = function() {
        return this._windowCursor;
    };

    Game_Picture.prototype.setWindowCursorActive = function(value) {
        this._windowCursorActive = value;
    };

    Game_Picture.prototype.getWindowCursorActive = function() {
        return this._windowCursorActive;
    };

    //=============================================================================
    // SceneManager
    //  æ–‡å­—æç”»ç”¨ã®éš&nbsp;ã—ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’å–å¾—ã—ã¾ã™ã€‚
    //=============================================================================
    SceneManager.getHiddenWindow = function() {
        if (!this._hiddenWindow) {
            this._hiddenWindow = new Window_Hidden(1, 1, 1, 1);
        }
        return this._hiddenWindow;
    };

    SceneManager.getSpriteset = function() {
        return this._scene._spriteset;
    };

    //=============================================================================
    // Window_Base
    //  æ–‡å­—åˆ—å¤‰æ›å‡¦ç†ã«è¿½åŠ&nbsp;åˆ¶å¾¡æ–‡å­—ã‚’è¨­å®šã—ã¾ã™ã€‚
    //=============================================================================
    var _Window_Base_convertEscapeCharacters      = Window_Base.prototype.convertEscapeCharacters;
    Window_Base.prototype.convertEscapeCharacters = function(text) {
        text = _Window_Base_convertEscapeCharacters.call(this, text);
        text = text.replace(/\x1bV\[(\d+),\s*(\d+)]/gi, function() {
            return this.getVariablePadCharacter($gameVariables.value(parseInt(arguments[1], 10)), arguments[2]);
        }.bind(this));
        text = text.replace(/\x1bITEM\[(\d+)]/gi, function() {
            var item = $dataItems[getArgNumber(arguments[1], 1, $dataItems.length)];
            return this.getItemInfoText(item);
        }.bind(this));
        text = text.replace(/\x1bWEAPON\[(\d+)]/gi, function() {
            var item = $dataWeapons[getArgNumber(arguments[1], 1, $dataWeapons.length)];
            return this.getItemInfoText(item);
        }.bind(this));
        text = text.replace(/\x1bARMOR\[(\d+)]/gi, function() {
            var item = $dataArmors[getArgNumber(arguments[1], 1, $dataArmors.length)];
            return this.getItemInfoText(item);
        }.bind(this));
        text = text.replace(/\x1bSKILL\[(\d+)]/gi, function() {
            var item = $dataSkills[getArgNumber(arguments[1], 1, $dataSkills.length)];
            return this.getItemInfoText(item);
        }.bind(this));
        text = text.replace(/\x1bSTATE\[(\d+)]/gi, function() {
            var item = $dataStates[getArgNumber(arguments[1], 1, $dataStates.length)];
            return this.getItemInfoText(item);
        }.bind(this));
        return text;
    };

    Window_Base.prototype.getItemInfoText = function(item) {
        if (!item) {
            return '';
        }
        return (this.isValidDTextIconSwitch() ? '\x1bi[' + item.iconIndex + ']' : '') + item.name;
    };

    Window_Base.prototype.isValidDTextIconSwitch = function() {
        return !param.itemIconSwitchId || $gameSwitches.value(param.itemIconSwitchId);
    };

    Window_Base.prototype.getVariablePadCharacter = function(value, digit) {
        var numText = String(Math.abs(value));
        var pad = String(param.padCharacter) || '0';
        while (numText.length &lt; digit) {
            numText = pad + numText;
        }
        return (value &lt; 0 ? '-' : '') + numText;
    };

    //=============================================================================
    // Sprite_Picture
    //  ç”»åƒã®å‹•çš„ç”Ÿæˆã‚’è¿½åŠ&nbsp;å®šç¾©ã—ã¾ã™ã€‚
    //=============================================================================
    var _Sprite_Picture_update      = Sprite_Picture.prototype.update;
    Sprite_Picture.prototype.update = function() {
        _Sprite_Picture_update.apply(this, arguments);
        if (this._frameWindow) {
            this.updateFrameWindow();
        }
    };

    Sprite_Picture.prototype.updateFrameWindow = function() {
        var padding               = this._frameWindow.standardPadding();
        this._frameWindow.x       = this.x - (this.anchor.x * this.width * this.scale.x) - padding;
        this._frameWindow.y       = this.y - (this.anchor.y * this.height * this.scale.y) - padding;
        this._frameWindow.opacity = this.opacity;
        if (!this.visible) {
            this.removeFrameWindow();
            return;
        }
        if (!this._addFrameWindow) {
            this.addFrameWindow();
        }
        if (Graphics.frameCount % 2 === 0) {
            this.adjustScaleFrameWindow();
        }
        this.updateFrameWindowCursor();
    };

    Sprite_Picture.prototype.updateFrameWindowCursor = function() {
        var picture = this.picture();
        if (!picture) {
            return;
        }
        var rect = picture.getWindowCursor();
        if (rect) {
            var width  = rect.width || this._frameWindow.contentsWidth();
            var height = rect.width || this._frameWindow.contentsHeight();
            this._frameWindow.setCursorRect(0, 0, width, height);
            this._frameWindow.active = picture.getWindowCursorActive();
        } else {
            this._frameWindow.setCursorRect(0, 0, 0, 0);
        }
    };

    Sprite_Picture.prototype.adjustScaleFrameWindow = function() {
        var padding        = this._frameWindow.standardPadding();
        var newFrameWidth  = Math.floor(this.width * this.scale.x + padding * 2);
        var newFrameHeight = Math.floor(this.height * this.scale.x + padding * 2);
        if (this._frameWindow.width !== newFrameWidth || this._frameWindow.height !== newFrameHeight) {
            this._frameWindow.move(this._frameWindow.x, this._frameWindow.y, newFrameWidth, newFrameHeight);
        }
    };

    Sprite_Picture.prototype.addFrameWindow = function() {
        var parent = this.parent;
        if (parent) {
            var index = parent.getChildIndex(this);
            parent.addChildAt(this._frameWindow, index);
            this._addFrameWindow = true;
        }
    };

    Sprite_Picture.prototype.removeFrameWindow = function() {
        var parent = this.parent;
        if (parent) {
            parent.removeChild(this._frameWindow);
            this._frameWindow    = null;
            this._addFrameWindow = false;
        }
    };

    var _Sprite_Picture_loadBitmap      = Sprite_Picture.prototype.loadBitmap;
    Sprite_Picture.prototype.loadBitmap = function() {
        this.dTextInfo = this.picture().dTextInfo;
        if (this.dTextInfo) {
            this.makeDynamicBitmap();
        } else {
            _Sprite_Picture_loadBitmap.apply(this, arguments);
        }
    };

    Sprite_Picture.prototype.makeDynamicBitmap = function() {
        this.textWidths   = [];
        this.hiddenWindow = SceneManager.getHiddenWindow();
        this.hiddenWindow.resetFontSettings(this.dTextInfo);
        var bitmapVirtual = new Bitmap_Virtual();
        this._processText(bitmapVirtual);
        this.hiddenWindow.resetFontSettings(this.dTextInfo);
        this.bitmap = new Bitmap(bitmapVirtual.width, bitmapVirtual.height);
        this.applyTextDecoration();
        this.bitmap.fontFace = this.hiddenWindow.contents.fontFace;
        if (this.dTextInfo.color) {
            this.bitmap.fillAll(this.dTextInfo.color);
            var h             = this.bitmap.height;
            var w             = this.bitmap.width;
            var gradationLeft = this.dTextInfo.gradationLeft;
            if (gradationLeft &gt; 0) {
                this.bitmap.clearRect(0, 0, gradationLeft, h);
                this.bitmap.gradientFillRect(0, 0, gradationLeft, h, 'rgba(0, 0, 0, 0)', this.dTextInfo.color, false);
            }
            var gradationRight = this.dTextInfo.gradationRight;
            if (gradationRight &gt; 0) {
                this.bitmap.clearRect(w - gradationRight, 0, gradationRight, h);
                this.bitmap.gradientFillRect(w - gradationRight, 0, gradationRight, h, this.dTextInfo.color, 'rgba(0, 0, 0, 0)', false);
            }
        }
        this._processText(this.bitmap);
        this._colorTone = [0, 0, 0, 0];
        if (this._frameWindow) {
            this.removeFrameWindow();
        }
        if (this.dTextInfo.windowFrame) {
            var scaleX = this.picture().scaleX() / 100;
            var scaleY = this.picture().scaleY() / 100;
            this.makeFrameWindow(bitmapVirtual.width * scaleX, bitmapVirtual.height * scaleY);
        }
        this.hiddenWindow = null;
    };

    Sprite_Picture.prototype.applyTextDecoration = function() {
        if (textDecParam.Mode &gt;= 0) {
            this.bitmap.outlineColor   =
                'rgba(%1,%2,%3,%4)'.format(textDecParam.Red, textDecParam.Green, textDecParam.Blue, textDecParam.Alpha / 255);
            this.bitmap.decorationMode = textDecParam.Mode;
        }
    };

    Sprite_Picture.prototype.makeFrameWindow = function(width, height) {
        var padding       = this.hiddenWindow.standardPadding();
        this._frameWindow = new Window_BackFrame(0, 0, width + padding * 2, height + padding * 2);
        if (param.frameWindowSkin) {
            this._frameWindow.windowskin = ImageManager.loadSystem(param.frameWindowSkin);
        }
    };

    Sprite_Picture.prototype._processText = function(bitmap) {
        var textState = {index: 0, x: 0, y: 0, text: this.dTextInfo.value, left: 0, line: -1, height: 0};
        this._processNewLine(textState, bitmap);
        textState.height = this.hiddenWindow.calcTextHeight(textState, false);
        textState.index  = 0;
        while (textState.text[textState.index]) {
            this._processCharacter(textState, bitmap);
        }
    };

    Sprite_Picture.prototype._processCharacter = function(textState, bitmap) {
        if (textState.text[textState.index] === '\x1b') {
            var code = this.hiddenWindow.obtainEscapeCode(textState);
            switch (code) {
                case 'C':
                    bitmap.textColor = this.hiddenWindow.textColor(this.hiddenWindow.obtainEscapeParam(textState));
                    break;
                case 'I':
                    this._processDrawIcon(this.hiddenWindow.obtainEscapeParam(textState), textState, bitmap);
                    break;
                case '{':
                    this.hiddenWindow.makeFontBigger();
                    break;
                case '}':
                    this.hiddenWindow.makeFontSmaller();
                    break;
                case 'F':
                    switch (this.hiddenWindow.obtainEscapeParamString(textState).toUpperCase()) {
                        case 'I':
                            bitmap.fontItalic = true;
                            break;
                        case 'B':
                            bitmap.fontBoldFotDtext = true;
                            break;
                        case '/':
                        case 'N':
                            bitmap.fontItalic       = false;
                            bitmap.fontBoldFotDtext = false;
                            break;
                    }
                    break;
                case 'OC':
                    var colorCode  = this.hiddenWindow.obtainEscapeParamString(textState);
                    var colorIndex = Number(colorCode);
                    if (!isNaN(colorIndex)) {
                        bitmap.outlineColor = this.hiddenWindow.textColor(colorIndex);
                    } else {
                        bitmap.outlineColor = colorCode;
                    }
                    break;
                case 'OW':
                    bitmap.outlineWidth = this.hiddenWindow.obtainEscapeParam(textState);
                    break;
            }
        } else if (textState.text[textState.index] === '\n') {
            this._processNewLine(textState, bitmap);
        } else {
            var c = textState.text[textState.index++];
            var w = this.hiddenWindow.textWidth(c);

            bitmap.fontSize = this.hiddenWindow.contents.fontSize;
            bitmap.drawText(c, textState.x, textState.y, w * 2, textState.height, 'left');
            textState.x += w;
        }
    };

    Sprite_Picture.prototype._processNewLine = function(textState, bitmap) {
        if (bitmap instanceof Bitmap_Virtual)
            this.textWidths[textState.line] = textState.x;
        this.hiddenWindow.processNewLine(textState);
        textState.line++;
        if (bitmap instanceof Bitmap)
            textState.x = (bitmap.width - this.textWidths[textState.line]) / 2 * this.dTextInfo.align;
    };

    Sprite_Picture.prototype._processDrawIcon = function(iconIndex, textState, bitmap) {
        var iconBitmap = ImageManager.loadSystem('IconSet');
        var pw         = Window_Base._iconWidth;
        var ph         = Window_Base._iconHeight;
        var sx         = iconIndex % 16 * pw;
        var sy         = Math.floor(iconIndex / 16) * ph;
        bitmap.blt(iconBitmap, sx, sy, pw, ph, textState.x + 2, textState.y + (textState.height - ph) / 2);
        textState.x += Window_Base._iconWidth + 4;
    };

    //=============================================================================
    // Bitmap_Virtual
    //  ã‚µã‚¤ã‚ºã‚’è¨ˆç®—ã™ã‚‹ãŸã‚ã®ä»®æƒ³ãƒ“ãƒƒãƒˆãƒžãƒƒãƒ—ã‚¯ãƒ©ã‚¹
    //=============================================================================
    function Bitmap_Virtual() {
        this.initialize.apply(this, arguments);
    }

    Bitmap_Virtual.prototype.initialize = function() {
        this.window = SceneManager.getHiddenWindow();
        this.width  = 0;
        this.height = 0;
    };

    Bitmap_Virtual.prototype.drawText = function(text, x, y) {
        var baseWidth = this.window.textWidth(text);
        var fontSize  = this.window.contents.fontSize;
        if (this.fontItalic) {
            baseWidth += Math.floor(fontSize / 6);
        }
        if (this.fontBoldFotDtext) {
            baseWidth += 2;
        }
        this.width  = Math.max(x + baseWidth, this.width);
        this.height = Math.max(y + fontSize + 8, this.height);
    };

    Bitmap_Virtual.prototype.blt = function(source, sx, sy, sw, sh, dx, dy, dw, dh) {
        this.width  = Math.max(dx + (dw || sw), this.width);
        this.height = Math.max(dy + (dh || sh), this.height);
    };

    //=============================================================================
    // Window_BackFrame
    //  ãƒãƒƒã‚¯ãƒ•ãƒ¬ãƒ¼ãƒ&nbsp;ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦
    //=============================================================================
    function Window_BackFrame() {
        this.initialize.apply(this, arguments);
    }

    Window_BackFrame.prototype.backOpacity = null;

    Window_BackFrame.prototype             = Object.create(Window_Base.prototype);
    Window_BackFrame.prototype.constructor = Window_BackFrame;

    Window_BackFrame.prototype.standardPadding = function() {
        return param.frameWindowPadding;
    };


    //=============================================================================
    // Window_Hidden
    //  æ–‡å­—æç”»ç”¨ã®éš&nbsp;ã—ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦
    //=============================================================================
    function Window_Hidden() {
        this.initialize.apply(this, arguments);
    }

    Window_Hidden.prototype.backOpacity = null;

    Window_Hidden.prototype             = Object.create(Window_Base.prototype);
    Window_Hidden.prototype.constructor = Window_Hidden;

    Window_Hidden.prototype._createAllParts = function() {
        this._windowBackSprite      = {};
        this._windowSpriteContainer = {};
        this._windowContentsSprite  = new Sprite();
        this.addChild(this._windowContentsSprite);
    };

    Window_Hidden.prototype._refreshAllParts = function() {};

    Window_Hidden.prototype._refreshBack = function() {};

    Window_Hidden.prototype._refreshFrame = function() {};

    Window_Hidden.prototype._refreshCursor = function() {};

    Window_Hidden.prototype._refreshArrows = function() {};

    Window_Hidden.prototype._refreshPauseSign = function() {};

    Window_Hidden.prototype.updateTransform = function() {};

    Window_Hidden.prototype.resetFontSettings = function(dTextInfo) {
        if (dTextInfo) {
            var customFont         = dTextInfo.font ? dTextInfo.font + ',' : '';
            this.contents.fontFace = customFont + this.standardFontFace();
            this.contents.fontSize = dTextInfo.size || this.standardFontSize();
        } else {
            Window_Base.prototype.resetFontSettings.apply(this, arguments);
        }
    };

    Window_Hidden.prototype.obtainEscapeParamString = function(textState) {
        var arr = /^\[.+?]/.exec(textState.text.slice(textState.index));
        if (arr) {
            textState.index += arr[0].length;
            return arr[0].substring(1, arr[0].length - 1);
        } else {
            return '';
        }
    };

    var _Window_Hidden_calcTextHeight = Window_Hidden.prototype.calcTextHeight;
    Window_Hidden.prototype.calcTextHeight = function(textState, all) {
        var result = _Window_Hidden_calcTextHeight.apply(this, arguments);
        if (param.lineSpacingVariableId) {
            result += $gameVariables.value(param.lineSpacingVariableId);
        }
        return result;
    };

    //=============================================================================
    // Bitmap
    //  å¤ªå­—å¯¾å¿œ
    //=============================================================================
    var _Bitmap__makeFontNameText      = Bitmap.prototype._makeFontNameText;
    Bitmap.prototype._makeFontNameText = function() {
        return (this.fontBoldFotDtext ? 'bold ' : '') + _Bitmap__makeFontNameText.apply(this, arguments);
    };
})();
</pre></body></html>