ptietz

Warper
Member
Joined
Jul 11, 2018
Messages
2
Reaction score
7
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:
king_john.png

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:

Latest Threads

Latest Posts

Latest Profile Posts

making my first game is like trying to stuff all my experience with old games into one
so its slow and painful when i dont get it right... i bet the next game is gonna be finished earlier!
When you don't find any time to work... :kaocry:
First Ten Minutes of my Caretaker inspired game

Finally, I got a good Gmail message [from smg5urded]
"This game does look a bit plain, but, I'm sure this does not destroy the experience as a whole. Monsters fit your style of game-play, mapping looks crude but I'm sure you can make it better if you do a remake of Forgotten Eclipse"
Going to start a new project today. OMG, it will be on RPGMaker MV. :D

Forum statistics

Threads
110,397
Messages
1,052,956
Members
143,455
Latest member
Pirata12
Top