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

[转载发布] Modified Map Name Display

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

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 2026-8-2 19:45:44 | 显示全部楼层 |阅读模式
    Map Name Display Plus v 1.0





    by Majirefy



    Introduction

    This script will dislpay your map name in a modified way when switching between maps in Ace.

    Features

    - Easy to custom style

    - Good for muti-language or add descriptions for map

    - Make your game more "PRO"(at least I believe that...  
      )

    How to Use


    • Paste above main
    • Turn to Scence_Map section, on Line 161, change @map_name_window = Window_MapName.new to @map_name_window = Window_MapNamePlus.new
    • In Map Properties window, set Display Name in format like: name1@name2. nam1 will be set above the split line and in bigger font size, while name2 will be below the split line and in smaller font size
    • Run your game and see the change.

    Demo

    MapNamePlus.zip

    Screenshot



    Script



                    Code:       
    1. # encoding: utf-8
    2. #==============================================================================
    3. # ** Window_MapNamePlus
    4. #------------------------------------------------------------------------------
    5. #  This window displays the map name.
    6. #------------------------------------------------------------------------------
    7. #        This class replaces the default Window_MapName class, adding more
    8. #   modification and custom.
    9. #------------------------------------------------------------------------------
    10. #  Author: Majirefy
    11. #------------------------------------------------------------------------------
    12. #  Guide:
    13. #        To use this script, create a new section below Materials in Script Editor
    14. #   and paste the script there. Then turn to Scene_Map section, find string
    15. #   "Window_MapName.new", replace it by "Winodw_MapNamePlus.new".
    16. #        Map name should be set in pattern like "拉普兰德@Lapland", using symbol "@"
    17. #   to split Chinese character and English text. You can also use "@" to split
    18. #   everything in map name.
    19. #------------------------------------------------------------------------------
    20. #  Version: 1.0 - 20120502
    21. #   First Release
    22. #==============================================================================
    23. class Window_MapNamePlus < Window_Base
    24.   #--------------------------------------------------------------------------
    25.   # * Settings
    26.   #--------------------------------------------------------------------------
    27.   FONT_NAME_CH = ["PMingLiU", "FangSong"]           # Chinese Font Name
    28.   FONT_SIZE_CH = 42                                                         # Chinese Font Size
    29.   FONT_NAME_EN = ["Monotype Corsiva"]                   # English Font Name
    30.   FONT_SIZE_EN = 28                                                         # English Font Size
    31.   FONT_BOLD        = false                                                  # True if Font in Bold
    32.   FONT_COLOR   = Color.new(255, 255, 255, 255)  # Color of Font
    33.   FONT_OUT         = true                                                   # True if Font Has Outline
    34.   OUT_COLOR        = Color.new(0, 0, 0, 200)                # Color of Outline Color of Font
    35.   FONT_SHADOW  = false                                                  # True if Text Drops Shadow
    36.   MODIFIER         = "~"                                                        # Modifier Added beside Map Name
    37.   PADDING          = 8                                                          # Padding between Window's Frame and Contents
    38.   LINE_HEIGHT  = 6                                                          # Height of Split Line
    39.   #--------------------------------------------------------------------------
    40.   # * Public Instance Variables
    41.   #--------------------------------------------------------------------------
    42.   attr_reader :map_name_ch                                          # Chinese Map Name
    43.   attr_reader :map_name_en                                          # English Map Name
    44.   attr_reader :line_x                                                   # Split Line X Coordinate
    45.   attr_reader :line_y                                                   # Split Line Y Coordinate
    46.   #--------------------------------------------------------------------------
    47.   # * Object Initialization
    48.   #--------------------------------------------------------------------------
    49.   def initialize
    50.         #----------------------------------------------------------------------
    51.         # * Set the window in the middle of screen.
    52.         #----------------------------------------------------------------------
    53.         super(((Graphics.width - window_width) / 2),
    54.           ((Graphics.height - (FONT_SIZE_CH + FONT_SIZE_EN + PADDING * 4 + LINE_HEIGHT)) / 2),
    55.           window_width, FONT_SIZE_CH + FONT_SIZE_EN + PADDING * 4 + LINE_HEIGHT)
    56.         #----------------------------------------------------------------------
    57.         # * Custom font and style.
    58.         #----------------------------------------------------------------------
    59.         contents.font.bold          = FONT_BOLD
    60.         contents.font.color         = FONT_COLOR
    61.         contents.font.outline   = FONT_OUT
    62.         contents.font.out_color = OUT_COLOR
    63.         contents.font.shadow        = FONT_SHADOW
    64.         #----------------------------------------------------------------------
    65.         # * Set Window Opacity
    66.         #----------------------------------------------------------------------
    67.         self.opacity = 0
    68.         self.contents_opacity = 0
    69.         @show_count = 0
    70.         refresh
    71.   end
    72.   #--------------------------------------------------------------------------
    73.   # * Get Window Width
    74.   #--------------------------------------------------------------------------
    75.   def window_width
    76.         return Graphics.width
    77.   end
    78.   #--------------------------------------------------------------------------
    79.   # * Frame Update
    80.   #--------------------------------------------------------------------------
    81.   def update
    82.         super
    83.         if @show_count > 0 && $game_map.name_display
    84.           update_fadein
    85.           @show_count -= 1
    86.         else
    87.           update_fadeout
    88.         end
    89.   end
    90.   #--------------------------------------------------------------------------
    91.   # * Update Fadein
    92.   #--------------------------------------------------------------------------
    93.   def update_fadein
    94.         self.contents_opacity += 16
    95.   end
    96.   #--------------------------------------------------------------------------
    97.   # * Update Fadeout
    98.   #--------------------------------------------------------------------------
    99.   def update_fadeout
    100.         self.contents_opacity -= 16
    101.   end
    102.   #--------------------------------------------------------------------------
    103.   # * Open Window
    104.   #--------------------------------------------------------------------------
    105.   def open
    106.         refresh
    107.         @show_count = 150
    108.         self.contents_opacity = 0
    109.         self
    110.   end
    111.   #--------------------------------------------------------------------------
    112.   # * Close Window
    113.   #--------------------------------------------------------------------------
    114.   def close
    115.         @show_count = 0
    116.         self
    117.   end
    118.   #--------------------------------------------------------------------------
    119.   # * Refresh
    120.   #--------------------------------------------------------------------------
    121.   def refresh
    122.         contents.clear
    123.         set_map_name
    124.         unless $game_map.display_name.empty?
    125.           draw_map_name
    126.         end
    127.   end
    128.   #--------------------------------------------------------------------------
    129.   # * Draw Line
    130.   #--------------------------------------------------------------------------
    131.   def draw_line(rect)
    132.         temp_rect = rect.clone
    133.         temp_rect.height = LINE_HEIGHT
    134.         temp_rect.width /= 4
    135.         contents.gradient_fill_rect(temp_rect, color2, color1)
    136.         temp_rect.x += temp_rect.width
    137.         temp_rect.width *= 2
    138.         contents.fill_rect(temp_rect, color1)
    139.         temp_rect.x += temp_rect.width
    140.         temp_rect.width /= 2
    141.         contents.gradient_fill_rect(temp_rect, color1, color2)
    142.   end
    143.   #--------------------------------------------------------------------------
    144.   # * Set Map Name
    145.   #--------------------------------------------------------------------------
    146.   def set_map_name
    147.         temp_map_name = $game_map.display_name.split("@")
    148.         @map_name_ch  = temp_map_name[0].to_s
    149.         @map_name_en  = MODIFIER + " " + temp_map_name[1].to_s + " " + MODIFIER
    150.   end
    151.   #--------------------------------------------------------------------------
    152.   # * Draw Map Name
    153.   #--------------------------------------------------------------------------
    154.   def draw_map_name
    155.         set_line_position
    156.         set_line_width
    157.         temp_line_rect = Rect.new(@line_x, @line_y, set_line_width, LINE_HEIGHT)
    158.         draw_line(temp_line_rect)
    159.         temp_name_rect_ch = Rect.new(0, 0, contents.width, FONT_SIZE_CH)
    160.         contents.font.name = FONT_NAME_CH
    161.         contents.font.size = FONT_SIZE_CH
    162.         draw_text(temp_name_rect_ch, @map_name_ch, 1)
    163.         temp_name_rect_en = Rect.new(0, FONT_SIZE_CH, contents.width, FONT_SIZE_EN)
    164.         contents.font.size = FONT_SIZE_EN
    165.         contents.font.name = FONT_NAME_EN
    166.         draw_text(temp_name_rect_en, @map_name_en, 1)
    167.   end
    168.   #--------------------------------------------------------------------------
    169.   # * Set Line Width
    170.   #--------------------------------------------------------------------------
    171.   def set_line_width
    172.         text_width_ch = text_size(@map_name_ch).width * 1.5
    173.         text_width_en = text_size(@map_name_en).width * 1.5
    174.         (text_width_ch >= text_width_en) ?
    175.           (text_width_ch) : (text_width_en)
    176.   end
    177.   #--------------------------------------------------------------------------
    178.   # * Set Line Position
    179.   #--------------------------------------------------------------------------
    180.   def set_line_position
    181.         @line_x = (contents.width - set_line_width) / 2
    182.         @line_y = (contents.height - LINE_HEIGHT) / 2
    183.   end
    184.   #--------------------------------------------------------------------------
    185.   # * Get Color 1
    186.   #--------------------------------------------------------------------------
    187.   def color1
    188.         Color.new(255, 255, 255, 255)
    189.   end
    190.   #--------------------------------------------------------------------------
    191.   # * Get Color 2
    192.   #--------------------------------------------------------------------------
    193.   def color2
    194.         Color.new(255, 255, 255, 0)
    195.   end
    196. end
    复制代码

    Notes

    This is my first time working with script and I am thirst to have some advices from you.

    Have fun and give me reply if that won't bother you!  
    :


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-17 08:30 , Processed in 0.138807 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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