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

[转载发布] ccoa's UMS name box position add-on

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

    连续签到: 2 天

    [LV.7]常住居民III

    5778

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 前天 19:14 | 显示全部楼层 |阅读模式
    ccoa's UMS Name Box Position Add-on
    by Black Mage


    Introduction
    I wanted to change the position of the name box in some situations, but UMS doesn't have an option for it.
    I had Black Mage create this add-on, so it's possible now.
    It works for both normal mode and FIT_WINDOW_TO_TEXT mode.

    Screenshots
    Spoiler












    How to Use
    Install: Copy and paste the script above Main and below UMS.

    Changing the value of
    1. $game_system.nb_align
    复制代码
    through script call.
    For example:
                    Ruby:       
    1. $game_system.nb_align = 1
    复制代码

    This will make the name box aligned to the center of the message window.
    Available values:
                            0 = Left
    1 = Center
    2 = Right               
    Click to expand...


    Script
    Spoiler                Ruby:       
    1. #-------------------------------------------------------------------------------
    2. # CCOA's UMS Addon By Black Mage
    3. # Version: 1.0
    4. #
    5. # https://burningwizard.wordpress.com/
    6. #-------------------------------------------------------------------------------
    7. #
    8. # This script is an addon for CCOA's UMS. It adds a function to change the
    9. # alignment of the name box by changing the value of
    10. #
    11. #   $game_system.nb_align
    12. #
    13. # through script call. For example:
    14. #
    15. #   $game_system.nb_align = 1
    16. #
    17. # This will make the name box aligned to the center of the message window.
    18. #
    19. # Available values:
    20. # 0 = Left
    21. # 1 = Center
    22. # 2 = Right
    23. #
    24. #-------------------------------------------------------------------------------
    25. module BM_UMS_Addon
    26.   def self.set_pos(alignment, x, y, w1, w2)
    27.     case alignment
    28.     when 0
    29.       pos = [x, y - 36]
    30.     when 1
    31.       pos = [x + ((w1 - w2 + 12)/2), y - 36]
    32.     when 2
    33.       pos = [x + w1 - w2 + 12, y - 36]
    34.     end
    35.     pos
    36.   end
    37. end
    38. class Game_System
    39.   attr_accessor :nb_align
    40.   alias b_init initialize
    41.   def initialize; b_init; @nb_align = 0; end
    42. end
    43. class Window_Message < Window_Selectable
    44.   alias b_r_w reset_window
    45.   def reset_window(change_opacity = true)
    46.     b_r_w(change_opacity)
    47.     if $game_system.name != ""
    48.       @name_window.set_name(@name)
    49.       pos = BM_UMS_Addon.set_pos($game_system.nb_align, self.x, self.y, self.width, @name_window.width)
    50.       @name_window.x = pos[0]; @name_window.y = pos[1]
    51.       @name_window.set_name($game_system.name)
    52.     end
    53.   end
    54. end
    55. class Window_Slave < Window_Base
    56.   alias b_r_w reset_window
    57.   def reset_window(change_opacity = true)
    58.     b_r_w(change_opacity)
    59.     if @name != "" and @name != nil
    60.       @name_window.set_name(@name)
    61.       pos = BM_UMS_Addon.set_pos($game_system.nb_align, self.x, self.y, self.width, @name_window.width)
    62.       @name_window.x = pos[0]; @name_window.y = pos[1]
    63.     end
    64.   end
    65. end
    复制代码







    Credits and Thanks
    - Black Mage


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-26 04:53 , Processed in 0.123413 second(s), 56 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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