❤❣ღ rpg maker mv收集 ❤❣ღ
㊕rpg maker mv新功能☪

〄数据库道具上限提升 ✿自动三层级地图
☪高分辨率游戏画面 触屏控制✿
____________________________________________
多设备支持:
输出Windows exe文件、Mac App文件、安卓Apk和iOS ipa✿
Mac、android、windows☪

即使你不用懂编程☪、不用会代码,依然能制作属于自己游戏✿
————————————————
转载于插件の素材の等资源,免费下载☪
✉开发: KADOKAWA ✿ Yoji Ojima
✉发行: Degica
 

自动换行【小插件】

制作作者:雅美引擎

字包插件帮助用户无包装的担忧使信息或描述,这意味着长文本将自动断线。

there is for this插件不需求。
免费的插件

下载

你可以抓住的插件在这里:
GitHub 
原始文本

指令

词的地方包插件低于其他引擎的核心插件,如yanfly发动机,并配置插件到你的味道。

该插件提供了以下代码信息或描述/帮助

<wrap> 
activates包装文字Word for the working

<breakword> 
使长的话被打破,应使用<wrap>

<br> 
在文本的任何地方使用手动断线


JS:

/*:

 * Yami Engine Delta - Word Wrap

 *

 * @plugindesc v1.0.0 This plugin provides word wrap feature, so that a long text will be properly broken down into lines.

 * @author Yami Engine Delta [Dr.Yami]

 *

 * @help

 * The word wrap isn't enabled by default. To activate word wrap in any text,

 * for example in Message, you have to put following code into the text:

 *

 *   <wrap>

 *

 * To make a long word to be broken, you can add the following code into the text:

 *

 *   <breakword>

 *

 * The word wrapper will nullify the break lines in editor, so that you have

 * to manually break line by using following code in text:

 *

 *   <br>

 *

 * ============================================================================

 */


(function() {

    var _Window_Base_processNormalCharacter

        = Window_Base.prototype.processNormalCharacter;

    var _Window_Base_convertEscapeCharacters

        = Window_Base.prototype.convertEscapeCharacters;


    Window_Base.prototype.textAreaWidth = function() {

        return this.contentsWidth();

    };


    Window_Base.prototype.needWrap = function(textState) {

        var c = textState.text[textState.index],

            w = this.textWidth(c),

            nextSpaceIndex = 0,

            nextBreakIndex = 0,

            nextWord = "",

            nextWidth = 0,

            text = textState.text,

            breakWord = !!this._breakWord;


        if (!this._yamiWordWrap) {

            return false;

        }


        if (breakWord && (textState.x + w * 2) >= this.textAreaWidth()) {

            textState.index--; // hack for missing character

            return true;

        }


        if (!breakWord && c === " ") {

            nextSpaceIndex = text.indexOf(" ", textState.index + 1);

            nextBreakIndex = text.indexOf("\n", textState.index + 1);


            if (nextSpaceIndex < 0) {

                nextSpaceIndex = text.length + 1;

            }


            if (nextBreakIndex > 0) {

                nextSpaceIndex = Math.min(nextSpaceIndex, nextBreakIndex);

            }


            nextWord = text.substring(textState.index, nextSpaceIndex);


            nextWidth = this.textWidth(nextWord);


            if (textState.x + nextWidth >= this.textAreaWidth()) {

                return true;

            }

        }


        return false;

    };


    Window_Base.prototype.convertEscapeCharacters = function(text) {

        text = _Window_Base_convertEscapeCharacters.call(this, text);

        text = this.convertWordWrapEscapeCharacters(text);


        return text;

    };


    Window_Base.prototype.convertWordWrapEscapeCharacters = function(text) {

        text = this.enableWordWrap(text);


        if (!!this._yamiWordWrap) {

            text = text.replace(/[\n\r]+/g, '');

            text = text.replace(/<br>/gi, '\n');

        }


        return text;

    };


    Window_Base.prototype.enableWordWrap = function(text) {

        this._yamiWordWrap = false;

        this._breakWord = false;


        if (!!text.match(/<wrap>/i)) {

            this._yamiWordWrap = true;

        }


        if (!!text.match(/<breakword>/i)) {

            this._breakWord = true;

        }


        text = text.replace(/<wrap>/gi, '');

        text = text.replace(/<breakword>/gi, '');


        return text;

    };


    Window_Base.prototype.processNormalCharacter = function(textState) {

        if (this.needWrap(textState)) {

            return this.processNewLine(textState);

        }


        _Window_Base_processNormalCharacter.call(this, textState);

    };

}());



 
评论
 
热度(2)