查看: 5130|回复: 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
星屑
90
在线时间
387 小时
注册时间
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 编辑

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


JS插件
  1. /*:
  2. * Yami Engine Delta - Word Wrap
  3. *
  4. * @plugindesc v1.0.0 This plugin provides word wrap feature, so that a long text will be properly broken down into lines.
  5. * @author Yami Engine Delta [Dr.Yami]
  6. *
  7. * @help
  8. * The word wrap isn't enabled by default. To activate word wrap in any text,
  9. * for example in Message, you have to put following code into the text:
  10. *
  11. *   <wrap>
  12. *
  13. * To make a long word to be broken, you can add the following code into the text:
  14. *
  15. *   <breakword>
  16. *
  17. * The word wrapper will nullify the break lines in editor, so that you have
  18. * to manually break line by using following code in text:
  19. *
  20. *   <br>
  21. *
  22. * ============================================================================
  23. */

  24. (function() {
  25.     var _Window_Base_processNormalCharacter
  26.         = Window_Base.prototype.processNormalCharacter;
  27.     var _Window_Base_convertEscapeCharacters
  28.         = Window_Base.prototype.convertEscapeCharacters;

  29.     Window_Base.prototype.textAreaWidth = function() {
  30.         return this.contentsWidth();
  31.     };

  32.     Window_Base.prototype.needWrap = function(textState) {
  33.         var c = textState.text[textState.index],
  34.             w = this.textWidth(c),
  35.             nextSpaceIndex = 0,
  36.             nextBreakIndex = 0,
  37.             nextWord = "",
  38.             nextWidth = 0,
  39.             text = textState.text,
  40.             breakWord = !!this._breakWord;

  41.         if (!this._yamiWordWrap) {
  42.             return false;
  43.         }

  44.         if (breakWord && (textState.x + w * 2) >= this.textAreaWidth()) {
  45.             textState.index--; // hack for missing character
  46.             return true;
  47.         }

  48.         if (!breakWord && c === " ") {
  49.             nextSpaceIndex = text.indexOf(" ", textState.index + 1);
  50.             nextBreakIndex = text.indexOf("\n", textState.index + 1);

  51.             if (nextSpaceIndex < 0) {
  52.                 nextSpaceIndex = text.length + 1;
  53.             }

  54.             if (nextBreakIndex > 0) {
  55.                 nextSpaceIndex = Math.min(nextSpaceIndex, nextBreakIndex);
  56.             }

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

  58.             nextWidth = this.textWidth(nextWord);

  59.             if (textState.x + nextWidth >= this.textAreaWidth()) {
  60.                 return true;
  61.             }
  62.         }

  63.         return false;
  64.     };

  65.     Window_Base.prototype.convertEscapeCharacters = function(text) {
  66.         text = _Window_Base_convertEscapeCharacters.call(this, text);
  67.         text = this.convertWordWrapEscapeCharacters(text);

  68.         return text;
  69.     };

  70.     Window_Base.prototype.convertWordWrapEscapeCharacters = function(text) {
  71.         text = this.enableWordWrap(text);

  72.         if (!!this._yamiWordWrap) {
  73.             text = text.replace(/[\n\r]+/g, '');
  74.             text = text.replace(/<br>/gi, '\n');
  75.         }

  76.         return text;
  77.     };

  78.     Window_Base.prototype.enableWordWrap = function(text) {
  79.         this._yamiWordWrap = false;
  80.         this._breakWord = false;

  81.         if (!!text.match(/<wrap>/i)) {
  82.             this._yamiWordWrap = true;
  83.         }

  84.         if (!!text.match(/<breakword>/i)) {
  85.             this._breakWord = true;
  86.         }

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

  89.         return text;
  90.     };

  91.     Window_Base.prototype.processNormalCharacter = function(textState) {
  92.         if (this.needWrap(textState)) {
  93.             return this.processNewLine(textState);
  94.         }

  95.         _Window_Base_processNormalCharacter.call(this, textState);
  96.     };
  97. }());
复制代码
PPT 制作
回复

使用道具 举报

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

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部