PT_EventMiniLabel_Ext

ptietz

Warper
Member
Joined
Jul 11, 2018
Messages
2
Reaction score
6
First Language
German
Primarily Uses
RMMV
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:

And here is how:
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:
<Mini Label: \c[4]King\c[0]<br>John>
<Mini Label: \c[4]Magister\c[0]<br>Maximilian>
<Mini Label: \c[5]Merchant\c[0]<br>George>
<Mini Label: You can have<br>as many lines<br>as you like.>

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:
Code:
/*:
 * @plugindesc v0.1 Allows for linebreaks in event labels.
 * @author Patrick Tietz <ptietz.official[at]gmail.com>
 *
 * @help
 *
 * ######################################
 * # General Instructions               #
 * ######################################
 *
 * Thank you for using EventMiniLabel_Ext.
 *
 * This Plugin extends YEP_EventMiniLabel
 * by adding support for YEP_MessageCore's
 * <br>-Tags.
 *
 * So, make sure to load this plugin
 * AFTER YEP_EventMiniLabel.
 *
 * The plugin does not add any plugin commands.
 *
 * Credits for the YEP-Plugins go to
 * the original auther Yanfly Engine Plugins.
 *
 * Have fun making games! :)
 *
 *
 * ######################################
 * # 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.
 *
 */

Window_EventMiniLabel.prototype.windowHeight = function(nl=1) {
    var height = this.fittingHeight(nl)
    height = Math.max(height, 36 + this.standardPadding() * 2);
    return height;
};

Window_EventMiniLabel.prototype.refresh = function() {
    if (Imported.YEP_SelfSwVar) {
      $gameTemp.setSelfSwVarEvent(this._character._mapId, this._character._eventId);
    }
    this.contents.clear();
 
    var txtArr = this._text.split( "<br>" );
    var maxTxWidth = 0;
    var txWidths = [];
    for ( var i = 0; i < txtArr.length; i++ )
    {
        var txWidth = this.textWidthEx(txtArr[i]);
        txWidths[i] = txWidth;
        maxTxWidth = maxTxWidth > txWidth ? maxTxWidth : txWidth;
    }
 
    maxTxWidth += this.textPadding() * 2;
    var width = maxTxWidth;
    this.width = Math.max(width, Yanfly.Param.EMWMinWidth);
    this.width += this.standardPadding() * 2;
    this.height = this.windowHeight( txtArr.length );
    this.createContents();
 
    for ( var i = 0; i < txtArr.length; i++ )
    {
        var tw = txWidths[i] + (this.textPadding() * 2);
        var wx = (this.contents.width - tw) / 2;
        console.log(wx);
        var wy = i * this.standardFontSize();
        this.drawTextEx(txtArr[i], wx + this.textPadding(), wy);
    }
 
    if (Imported.YEP_SelfSwVar) $gameTemp.clearSelfSwVarEvent();
};

Have a good one & Happy game making :)
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Managed to find a way to hang a bed cover over my window. So no more being toasted alive in the afternoon!:kaoswt2:
So, uh, has anyone tried buying any resources from KokoroReflections? Because I've been looking for a 'buy' button on the site for like 10 minutes now and can't find one.
Any also thought it's too cringy to put the word "and you" in your credit as a special thanks?
Cause that's what I thought...
Everyone in the US right now: Please stay safe.
Symphony Celestia: Prophecy of the Falling Stars RPG Maker music pack WIP. Symphony Celestia is a new series that focuses on symphonic and orchestrated music to tell a story. Each story will include compositions that make up that story from beginning to end. Themes include: Battles, adventures, character themes, etc. Below is a video preview to the first story.

Forum statistics

Threads
97,979
Messages
948,308
Members
129,241
Latest member
LordCola
Top