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

[转载发布] HP and MP numeric values resize

[复制链接]
累计送礼:
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 21:58:29 | 显示全部楼层 |阅读模式
    HP and MP Value Resize - 1.0
    Kissá


    Introduction

    Resizes the HP and MP numeric values in menus and battles apart from the default.

    Features

    - Changes the default font size of the game;

    - Changes the HP and MP value's font size apart from the default;

    - Changes the space between Current HP/MP and Max HP/MP.

    History

    So... I made it specifically for my game.

    I have always find very cool having the HP and MP values bigger than the rest of the text shown in windows (who knows... Maybe there is someone somewhere else whith this same taste).

    I failed at finding something like this on the internet (found just plugins that changes the size of the bars), then, I decided having a try doing it (I think it looked pretty nice with the custom font I am using).

    It is, actually, my first attempt to write a plugin and my first time ever with coding.

    Screenshots
    Spoiler





















    How to Use

    There are three parameters: fontsize for the default font size of the game (you imput a number), numbersize for the HP and MP values font size (you put a number), and numberwidth to change the space between max and current HP and MP values.

    For this third one, you write more characters (usually zero's) to have more space (default is = '0000'), or less characters for less space.

    Script
    Spoiler                Code:       
    1. //==============================================================================
    2. // Kissá - HP and MP Value Resize
    3. //==============================================================================
    4. //------------------------------------------------------------------------------
    5. // KSS_HPMPvalueResize.js
    6. //------------------------------------------------------------------------------
    7. // =============================================================================
    8. /*:
    9. *
    10. * @plugindesc Changes HP and MP's values font size apart from the default game's
    11. * size.
    12. *
    13. * @author Kissa
    14. *
    15. * @param fontsize
    16. * @desc Changes the default font size of the game.
    17. * default = 28
    18. * @default 28
    19. *
    20. * @param numbersize
    21. * @desc Changes the size of the HP and MP numeric values.
    22. * default = 28
    23. * @default 28
    24. *
    25. * @param numberwidth
    26. * @desc Changes the space between max and current values of HP
    27. * and MP. Add zeros for more space. Default = 0000
    28. * @default '0000'
    29. *
    30. * @help
    31. *
    32. * Parameters ===================================================================
    33. *
    34. * font size = Changes the default font size of the game.
    35. *
    36. * numbersize = Changes only the HP and MP numeric value's font size in menus and
    37. * battles.
    38. *
    39. * numberwidth = Changes the space between max and current values of HP and MP.
    40. * Write more zeros to have more space between current and max values
    41. * (or less space with less zeros).
    42. *
    43. * Terms of use ==================================================================
    44. *
    45. * I made it for my game, I thought that something like this would work well
    46. * for the font I am using in my project (and it really did, that's why this plugin
    47. * is something so specific), but you are free to use it in a non comercial or
    48. * comercial game.
    49. *
    50. */
    51. (function() {
    52. // Variables ====================================================================================
    53.     var parameters = PluginManager.parameters('KSS_HPMPvalueResize');
    54.     var fontsize = Number(parameters['fontsize']);
    55.     var numbersize = Number(parameters['numbersize']);
    56.     var numberwidth = parameters['numberwidth'];
    57. // Game font size ===============================================================================
    58.     Window_Base.prototype.standardFontSize = function() {
    59.             return fontsize;
    60.     };
    61. // HP and MP numbers font size and width ========================================================
    62.     Window_Base.prototype.drawCurrentAndMax = function(current, max, x, y,
    63.                                                    width, color1, color2) {
    64.           var labelWidth = this.textWidth('HP');
    65.             var valueWidth = this.textWidth(numberwidth);
    66.             var slashWidth = this.textWidth('/');
    67.             var x1 = x + width - valueWidth;
    68.             var x2 = x1 - slashWidth;
    69.             var x3 = x2 - valueWidth;
    70.         this.contents.fontSize = numbersize
    71.             if (x3 >= x + labelWidth) {
    72.             this.changeTextColor(color1);
    73.             this.drawText(current, x3, y, valueWidth, 'right');
    74.             this.changeTextColor(color2);
    75.             this.drawText('/', x2, y, slashWidth, 'right');
    76.             this.drawText(max, x1, y, valueWidth, 'right');
    77.             } else {
    78.             this.changeTextColor(color1);
    79.             this.drawText(current, x1, y, valueWidth, 'right');
    80.             }
    81.     };
    82. // MP text font size ============================================================================
    83.     Window_Base.prototype.drawActorHp = function(actor, x, y, width) {
    84.             width = width || 186;
    85.             var color1 = this.hpGaugeColor1();
    86.             var color2 = this.hpGaugeColor2();
    87.             this.drawGauge(x, y, width, actor.hpRate(), color1, color2);
    88.             this.changeTextColor(this.systemColor());
    89.             this.drawText(TextManager.hpA, x, y, 44);
    90.             this.drawCurrentAndMax(actor.hp, actor.mhp, x, y, width,
    91.                     this.hpColor(actor), this.normalColor());
    92.         this.contents.fontSize = fontsize;
    93.     };
    94. // HP and actor text font size ==================================================================
    95.     Window_Base.prototype.drawActorMp = function(actor, x, y, width) {
    96.             width = width || 186;
    97.             var color1 = this.mpGaugeColor1();
    98.             var color2 = this.mpGaugeColor2();
    99.             this.drawGauge(x, y, width, actor.mpRate(), color1, color2);
    100.             this.changeTextColor(this.systemColor());
    101.           this.drawText(TextManager.mpA, x, y, 44);
    102.           this.drawCurrentAndMax(actor.mp, actor.mmp, x, y, width,
    103.                            this.mpColor(actor), this.normalColor());
    104.         this.contents.fontSize = fontsize;
    105.     };
    106. })();
    复制代码






    Terms of use

    Free to use in comercial or non-comercial games.


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-22 07:52 , Processed in 0.118147 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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