设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 131|回复: 0

[转载发布] PT_EventMiniLabel_Ext

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9072

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58885
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68851

    灌水之王

    发表于 2026-7-26 18:34:23 | 显示全部楼层 |阅读模式
    Hi everyone!

    I'm fairly new to RPGMV and this forum.
    So please, forgive me if I'm doing anything out of the ordinary, here.

    The reason I registered is to share my first little plugin with you guys,
    hoping you'll find some use in it.

    The Plugin
    PT_EventMiniLabel_Ext is an extension of the famous YEP_EventMiniLabel-Plugin
    and allows for YEP_MessageCore-style line breaks in the form of <br> in your labels.

    Here's what you get:
    Spoiler: Screenshot
    [/quote]

    And here is how:
    Spoiler: How to use[quote]Make sure to load this plugin AFTER YEP_EventMiniLabel!

    Simply place your event label in the comment box as usual.
    You can now use the <br>-Tags like so:
                    Code:       
    1. <Mini Label: \c[4]King\c[0]<br>John>
    2. <Mini Label: \c[4]Magister\c[0]<br>Maximilian>
    3. <Mini Label: \c[5]Merchant\c[0]<br>George>
    4. <Mini Label: You can have<br>as many lines<br>as you like.>
    复制代码


    Terms of use:
    Spoiler: Terms of use
    You may freely use, copy and modify this script
    in any commercial or non-commercial game.

    Re-distribution of the source code as is, is prohibited.
    You may link to the source, you got it from, though.
    The distribution of your modified code is allowed,
    as long as the original author is kept visible.

    Crediting the author in the game, however,
    is not required, although much appreciated.

    Screenshots packed with this plugin are for
    demonstrational purpose only.
    Credits for the original software
    "RPG Maker MV" go to
    Copyright (c) 2015 KADOKAWA CORPORATION / YOJI OJIMA

    *** PLEASE DO MAKE SURE TO MEET YANFLY'S
    TERMS OF USE AS WELL.
    Source code below:
    Spoiler: Plugin source code
                    Code:       
    1. /*:
    2. * @plugindesc v0.1 Allows for linebreaks in event labels.
    3. * @author Patrick Tietz <ptietz.official[at]gmail.com>
    4. *
    5. * @help
    6. *
    7. * ######################################
    8. * # General Instructions               #
    9. * ######################################
    10. *
    11. * Thank you for using EventMiniLabel_Ext.
    12. *
    13. * This Plugin extends YEP_EventMiniLabel
    14. * by adding support for YEP_MessageCore's
    15. * <br>-Tags.
    16. *
    17. * So, make sure to load this plugin
    18. * AFTER YEP_EventMiniLabel.
    19. *
    20. * The plugin does not add any plugin commands.
    21. *
    22. * Credits for the YEP-Plugins go to
    23. * the original auther Yanfly Engine Plugins.
    24. *
    25. * Have fun making games! :)
    26. *
    27. *
    28. * ######################################
    29. * # Terms of use                       #
    30. * ######################################
    31. *
    32. * You may freely use, copy and modify this script
    33. * in any commercial or non-commercial game.
    34. *
    35. * Re-distribution of the source code as is, is prohibited.
    36. * You may link to the source, you got it from, though.
    37. * The distribution of your modified code is allowed,
    38. * as long as the original author is kept visible.
    39. *
    40. * Crediting the author in the game, however,
    41. * is not required, although much appreciated.
    42. *
    43. * Screenshots packed with this plugin are for
    44. * demonstrational purpose only.
    45. * Credits for the original software
    46. * "RPG Maker MV" go to
    47. * Copyright (c) 2015 KADOKAWA CORPORATION / YOJI OJIMA
    48. *
    49. * *** PLEASE DO MAKE SURE TO MEET YANFLY'S
    50. * TERMS OF USE AS WELL.
    51. *
    52. */
    53. Window_EventMiniLabel.prototype.windowHeight = function(nl=1) {
    54.     var height = this.fittingHeight(nl)
    55.     height = Math.max(height, 36 + this.standardPadding() * 2);
    56.     return height;
    57. };
    58. Window_EventMiniLabel.prototype.refresh = function() {
    59.     if (Imported.YEP_SelfSwVar) {
    60.       $gameTemp.setSelfSwVarEvent(this._character._mapId, this._character._eventId);
    61.     }
    62.     this.contents.clear();
    63.     var txtArr = this._text.split( "<br>" );
    64.     var maxTxWidth = 0;
    65.     var txWidths = [];
    66.     for ( var i = 0; i < txtArr.length; i++ )
    67.     {
    68.         var txWidth = this.textWidthEx(txtArr[i]);
    69.         txWidths[i] = txWidth;
    70.         maxTxWidth = maxTxWidth > txWidth ? maxTxWidth : txWidth;
    71.     }
    72.     maxTxWidth += this.textPadding() * 2;
    73.     var width = maxTxWidth;
    74.     this.width = Math.max(width, Yanfly.Param.EMWMinWidth);
    75.     this.width += this.standardPadding() * 2;
    76.     this.height = this.windowHeight( txtArr.length );
    77.     this.createContents();
    78.     for ( var i = 0; i < txtArr.length; i++ )
    79.     {
    80.         var tw = txWidths[i] + (this.textPadding() * 2);
    81.         var wx = (this.contents.width - tw) / 2;
    82.         console.log(wx);
    83.         var wy = i * this.standardFontSize();
    84.         this.drawTextEx(txtArr[i], wx + this.textPadding(), wy);
    85.     }
    86.     if (Imported.YEP_SelfSwVar) $gameTemp.clearSelfSwVarEvent();
    87. };
    复制代码


    Have a good one & Happy game making



    本贴来自国际rpgmaker官方论坛作者:ptietz处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/pt_eventminilabel_ext.97534/

    本帖子中包含更多资源

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

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-22 08:38 , Processed in 0.139455 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表