Project1

标题: 求RMVA双地图名脚本 [打印本页]

作者: 夢魘    时间: 2012-10-13 13:10
标题: 求RMVA双地图名脚本
以前看过的,结果居然想不起来在哪看到的了 dsu_plus_rewardpost_czw
作者: 布里蓝    时间: 2012-10-13 14:11
http://rpg.blue/forum.php?mod=viewthread&tid=230447
作者: 约修亚_RK    时间: 2012-10-18 17:50
@夢魘
是的,有这样一个脚本。
使用方法:把地图名改成“中文名@英文名”的形式。
另外在“Scene_Map”中找到“Window_MapName.new”,改成"Window_MapNamePlus.new"(大概在159行左右)

(以上说明包含在脚本中,原地址不清楚,在多拉君的整合中有。)
RUBY 代码复制
  1. # encoding: utf-8
  2. #==============================================================================
  3. # ** Window_MapNamePlus
  4. #------------------------------------------------------------------------------
  5. #  This window displays the map name.
  6. #------------------------------------------------------------------------------
  7. #  使用方法:
  8. #    新建脚本页,复制粘贴
  9. #    在“Scene_Map”中找到“Window_MapName.new”,改成"Window_MapNamePlus.new"(大概在
  10. #     159行左右)
  11. #    在地图属性的设置窗口,“显示名称”中的地图名格式:“中文名@EnglishName”,即用“@”分割中文
  12. #     和英文地图名
  13. #==============================================================================
  14.  
  15. class Window_MapNamePlus < Window_Base
  16.   #--------------------------------------------------------------------------
  17.   # * Settings
  18.   #--------------------------------------------------------------------------
  19.   FONT_NAME_CH = ["迷你简行楷", "楷体_GB2312"]       # Chinese Font Name
  20.   FONT_SIZE_CH = 42                             # Chinese Font Size
  21.   FONT_NAME_EN = ["Monotype Corsiva"]           # English Font Name
  22.   FONT_SIZE_EN = 28                             # English Font Size
  23.   FONT_BOLD    = false                          # True if Font in Bold
  24.   FONT_COLOR   = Color.new(255, 255, 255, 255)  # Color of Font
  25.   FONT_OUT     = true                           # True if Font Has Outline
  26.   OUT_COLOR    = Color.new(0, 0, 0, 200)        # Color of Outline Color of Font
  27.   FONT_SHADOW  = false                          # True if Text Drops Shadow
  28.   MODIFIER     = "~"                            # Modifier Added beside Map Name
  29.   PADDING      = 8                              # Padding between Window's Frame and Contents
  30.   LINE_HEIGHT  = 6                              # Height of Split Line
  31.   #--------------------------------------------------------------------------
  32.   # * Public Instance Variables
  33.   #--------------------------------------------------------------------------
  34.   attr_reader :map_name_ch                      # Chinese Map Name
  35.   attr_reader :map_name_en                      # English Map Name
  36.   attr_reader :line_x                           # Split Line X Coordinate
  37.   attr_reader :line_y                           # Split Line Y Coordinate
  38.   #--------------------------------------------------------------------------
  39.   # * Object Initialization
  40.   #--------------------------------------------------------------------------
  41.   def initialize
  42.     #----------------------------------------------------------------------
  43.     # * Set the window in the middle of screen.
  44.     #----------------------------------------------------------------------
  45.     super(((Graphics.width - window_width) / 2),
  46.       ((Graphics.height - (FONT_SIZE_CH + FONT_SIZE_EN + PADDING * 4 + LINE_HEIGHT)) / 2),
  47.       window_width, FONT_SIZE_CH + FONT_SIZE_EN + PADDING * 4 + LINE_HEIGHT)
  48.     #----------------------------------------------------------------------
  49.     # * Custom font and style.
  50.     #----------------------------------------------------------------------
  51.     contents.font.bold      = FONT_BOLD
  52.     contents.font.color     = FONT_COLOR
  53.     contents.font.outline   = FONT_OUT
  54.     contents.font.out_color = OUT_COLOR
  55.     contents.font.shadow    = FONT_SHADOW
  56.     #----------------------------------------------------------------------
  57.     # * Set Window Opacity
  58.     #----------------------------------------------------------------------
  59.     self.opacity = 0
  60.     self.contents_opacity = 0
  61.     @show_count = 0
  62.     refresh
  63.   end
  64.   #--------------------------------------------------------------------------
  65.   # * Get Window Width
  66.   #--------------------------------------------------------------------------
  67.   def window_width
  68.     return Graphics.width
  69.   end
  70.   #--------------------------------------------------------------------------
  71.   # * Frame Update
  72.   #--------------------------------------------------------------------------
  73.   def update
  74.     super
  75.     if @show_count > 0 && $game_map.name_display
  76.       update_fadein
  77.       @show_count -= 1
  78.     else
  79.       update_fadeout
  80.     end
  81.   end
  82.   #--------------------------------------------------------------------------
  83.   # * Update Fadein
  84.   #--------------------------------------------------------------------------
  85.   def update_fadein
  86.     self.contents_opacity += 16
  87.   end
  88.   #--------------------------------------------------------------------------
  89.   # * Update Fadeout
  90.   #--------------------------------------------------------------------------
  91.   def update_fadeout
  92.     self.contents_opacity -= 16
  93.   end
  94.   #--------------------------------------------------------------------------
  95.   # * Open Window
  96.   #--------------------------------------------------------------------------
  97.   def open
  98.     refresh
  99.     @show_count = 150
  100.     self.contents_opacity = 0
  101.     self
  102.   end
  103.   #--------------------------------------------------------------------------
  104.   # * Close Window
  105.   #--------------------------------------------------------------------------
  106.   def close
  107.     @show_count = 0
  108.     self
  109.   end
  110.   #--------------------------------------------------------------------------
  111.   # * Refresh
  112.   #--------------------------------------------------------------------------
  113.   def refresh
  114.     contents.clear
  115.     set_map_name
  116.     unless $game_map.display_name.empty?
  117.       draw_map_name
  118.     end
  119.   end
  120.   #--------------------------------------------------------------------------
  121.   # * Draw Line
  122.   #--------------------------------------------------------------------------
  123.   def draw_line(rect)
  124.     temp_rect = rect.clone
  125.     temp_rect.height = LINE_HEIGHT
  126.     temp_rect.width /= 4
  127.     contents.gradient_fill_rect(temp_rect, color2, color1)
  128.     temp_rect.x += temp_rect.width
  129.     temp_rect.width *= 2
  130.     contents.fill_rect(temp_rect, color1)
  131.     temp_rect.x += temp_rect.width
  132.     temp_rect.width /= 2
  133.     contents.gradient_fill_rect(temp_rect, color1, color2)
  134.   end
  135.   #--------------------------------------------------------------------------
  136.   # * Set Map Name
  137.   #--------------------------------------------------------------------------
  138.   def set_map_name
  139.     temp_map_name = $game_map.display_name.split("@")
  140.     @map_name_ch  = temp_map_name[0].to_s
  141.     @map_name_en  = MODIFIER + " " + temp_map_name[1].to_s + " " + MODIFIER
  142.   end
  143.   #--------------------------------------------------------------------------
  144.   # * Draw Map Name
  145.   #--------------------------------------------------------------------------
  146.   def draw_map_name
  147.     set_line_position
  148.     set_line_width
  149.     temp_line_rect = Rect.new(@line_x, @line_y, set_line_width, LINE_HEIGHT)
  150.     draw_line(temp_line_rect)
  151.     temp_name_rect_ch = Rect.new(0, 0, contents.width, FONT_SIZE_CH)
  152.     contents.font.name = FONT_NAME_CH
  153.     contents.font.size = FONT_SIZE_CH
  154.     draw_text(temp_name_rect_ch, @map_name_ch, 1)
  155.     temp_name_rect_en = Rect.new(0, FONT_SIZE_CH, contents.width, FONT_SIZE_EN)
  156.     contents.font.size = FONT_SIZE_EN
  157.     contents.font.name = FONT_NAME_EN
  158.     draw_text(temp_name_rect_en, @map_name_en, 1)
  159.   end
  160.   #--------------------------------------------------------------------------
  161.   # * Set Line Width
  162.   #--------------------------------------------------------------------------
  163.   def set_line_width
  164.     text_width_ch = text_size(@map_name_ch).width * 1.5
  165.     text_width_en = text_size(@map_name_en).width * 1.5
  166.     (text_width_ch >= text_width_en) ?
  167.       (text_width_ch) : (text_width_en)
  168.   end
  169.   #--------------------------------------------------------------------------
  170.   # * Set Line Position
  171.   #--------------------------------------------------------------------------
  172.   def set_line_position
  173.     @line_x = (contents.width - set_line_width) / 2
  174.     @line_y = (contents.height - LINE_HEIGHT) / 2
  175.   end
  176.   #--------------------------------------------------------------------------
  177.   # * Get Color 1
  178.   #--------------------------------------------------------------------------
  179.   def color1
  180.     Color.new(255, 255, 255, 255)
  181.   end
  182.   #--------------------------------------------------------------------------
  183.   # * Get Color 2
  184.   #--------------------------------------------------------------------------
  185.   def color2
  186.     Color.new(255, 255, 255, 0)
  187.   end
  188. end

作者: 迷糊的安安    时间: 2012-10-18 21:33
简易版的
http://rpg.blue/thread-233881-1-1.html
效果如图





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1