查看: 5062|回复: 6

[已经解决] 有没有自动換行的插件啊 ...

[复制链接]
梦石
0
星屑
50
在线时间
34 小时
注册时间
2016-1-7
回帖
56
发表于 2016-1-9 20:11:04 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
请教 ...


请教 ...




梦石
0
星屑
50
在线时间
34 小时
注册时间
2016-1-7
回帖
56
 楼主| 发表于 2016-1-9 20:12:38 | 显示全部楼层
补充~  就是输入文字时~
自动換下一行~
回复

使用道具 举报

梦石
0
星屑
497
在线时间
266 小时
注册时间
2015-12-8
回帖
729
发表于 2016-1-9 20:47:59 | 显示全部楼层
沒有
回复

使用道具 举报

梦石
0
星屑
1225
在线时间
564 小时
注册时间
2014-11-30
回帖
126
发表于 2016-1-9 21:12:33 来自手机 | 显示全部楼层
3楼正解
回复

使用道具 举报

梦石
0
星屑
80
在线时间
386 小时
注册时间
2007-7-27
回帖
4075

开拓者

发表于 2016-1-9 21:33:14 | 显示全部楼层
我不懂
是发贴快,还是直接在搜索栏搜换行,然后按搜索快
明明可以搜到,喷了

评分

参与人数 2星屑 +20 收起 理由
夏末渐离 + 10 我很赞同
andrewx + 10 我很赞同

查看全部评分

吸吸
回复

使用道具 举报

梦石
0
星屑
50
在线时间
289 小时
注册时间
2014-12-12
回帖
138
发表于 2016-1-9 22:25:10 | 显示全部楼层
本帖最后由 13790758417 于 2016-1-9 22:26 编辑

不知道为什么新人爱伸手,,,自己找即可了吗


[fold=JS插件][pre lang="javascript"]/*:
* 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);
    };
}());[/pre][/fold]
PPT 制作
回复

使用道具 举报

梦石
0
星屑
60
在线时间
306 小时
注册时间
2014-8-5
回帖
403
发表于 2016-1-11 18:24:55 | 显示全部楼层
  点我进入    
       ↓      
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部