| 哦,天……那只狮子一看就来头不小! |
哦!原来是那个,您把 Scene_Map 第 160 行的
没改之前是建立默认脚本的 Window_MapName 方法,而不是 Window_MapNamePlus, 所以脚本程式执行时出了问题。 |
|
本帖最后由 j433463 于 2013-1-13 20:48 编辑 您不说明白错误讯息,我也不知道您那报错的原因。 要不您试试我这改过的双行美化脚本吧,之前有人问过英文地图名的 @ 冲突问题, 我给改的,英文名称改成在备注栏中用 <enmap:英文地图名> 方式,不用 @ 了: [pre lang="ruby" line="1"]# encoding: utf-8 #============================================================================== # ** Window_MapNamePlus #------------------------------------------------------------------------------ # This window displays the map name. #------------------------------------------------------------------------------ # 使用方法: # 新建脚本页,复制粘贴 # 在“Scene_Map”中找到“Window_MapName.new”,改成"Window_MapNamePlus.new"(大概在 # 159行左右) # 在地图属性的设置窗口,“显示名称”中的地图名格式:“中文名@EnglishName”,即用“@”分割中文 # 和英文地图名 #============================================================================== class Window_MapNamePlus < Window_Base #-------------------------------------------------------------------------- # * Settings #-------------------------------------------------------------------------- FONT_NAME_CH = ["PMingLiU", "FangSong"] # Chinese Font Name FONT_SIZE_CH = 42 # Chinese Font Size FONT_NAME_EN = ["Monotype Corsiva"] # English Font Name FONT_SIZE_EN = 28 # English Font Size FONT_BOLD = false # True if Font in Bold FONT_COLOR = Color.new(255, 255, 255, 255) # Color of Font FONT_OUT = true # True if Font Has Outline OUT_COLOR = Color.new(0, 0, 0, 200) # Color of Outline Color of Font FONT_SHADOW = false # True if Text Drops Shadow MODIFIER = "~" # Modifier Added beside Map Name PADDING = 8 # Padding between Window's Frame and Contents LINE_HEIGHT = 6 # Height of Split Line #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :map_name_ch # Chinese Map Name attr_reader :map_name_en # English Map Name attr_reader :line_x # Split Line X Coordinate attr_reader :line_y # Split Line Y Coordinate #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize #---------------------------------------------------------------------- # * Set the window in the middle of screen. #---------------------------------------------------------------------- super(((Graphics.width - window_width) / 2), ((Graphics.height - (FONT_SIZE_CH + FONT_SIZE_EN + PADDING * 4 + LINE_HEIGHT)) / 2), window_width, FONT_SIZE_CH + FONT_SIZE_EN + PADDING * 4 + LINE_HEIGHT) #---------------------------------------------------------------------- # * Custom font and style. #---------------------------------------------------------------------- contents.font.bold = FONT_BOLD contents.font.color = FONT_COLOR contents.font.outline = FONT_OUT contents.font.out_color = OUT_COLOR contents.font.shadow = FONT_SHADOW #---------------------------------------------------------------------- # * Set Window Opacity #---------------------------------------------------------------------- self.opacity = 0 self.contents_opacity = 0 @show_count = 0 refresh end #-------------------------------------------------------------------------- # * Get Window Width #-------------------------------------------------------------------------- def window_width return Graphics.width end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super if @show_count > 0 && $game_map.name_display update_fadein @show_count -= 1 else update_fadeout end end #-------------------------------------------------------------------------- # * Update Fadein #-------------------------------------------------------------------------- def update_fadein self.contents_opacity += 16 end #-------------------------------------------------------------------------- # * Update Fadeout #-------------------------------------------------------------------------- def update_fadeout self.contents_opacity -= 16 end #-------------------------------------------------------------------------- # * Open Window #-------------------------------------------------------------------------- def open refresh @show_count = 150 self.contents_opacity = 0 self end #-------------------------------------------------------------------------- # * Close Window #-------------------------------------------------------------------------- def close @show_count = 0 self end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh contents.clear set_map_name unless $game_map.display_name.empty? draw_map_name end end #-------------------------------------------------------------------------- # * Draw Line #-------------------------------------------------------------------------- def draw_line(rect) temp_rect = rect.clone temp_rect.height = LINE_HEIGHT temp_rect.width /= 4 contents.gradient_fill_rect(temp_rect, color2, color1) temp_rect.x += temp_rect.width temp_rect.width *= 2 contents.fill_rect(temp_rect, color1) temp_rect.x += temp_rect.width temp_rect.width /= 2 contents.gradient_fill_rect(temp_rect, color1, color2) end #-------------------------------------------------------------------------- # * Set Map Name #-------------------------------------------------------------------------- def set_map_name #temp_map_name = $game_map.display_name.split("@") #@map_name_ch = temp_map_name[0].to_s #@map_name_en = MODIFIER + " " + temp_map_name[1].to_s + " " + MODIFIER @map_name_ch = $game_map.display_name $game_map.note.sub!(/<enmap:(.*?)>/i, "") @map_name_en = $1.to_s end #-------------------------------------------------------------------------- # * Draw Map Name #-------------------------------------------------------------------------- def draw_map_name set_line_position set_line_width temp_line_rect = Rect.new(@line_x, @line_y, set_line_width, LINE_HEIGHT) draw_line(temp_line_rect) temp_name_rect_ch = Rect.new(0, 0, contents.width, FONT_SIZE_CH) contents.font.name = FONT_NAME_CH contents.font.size = FONT_SIZE_CH draw_text(temp_name_rect_ch, @map_name_ch, 1) temp_name_rect_en = Rect.new(0, FONT_SIZE_CH, contents.width, FONT_SIZE_EN) contents.font.size = FONT_SIZE_EN contents.font.name = FONT_NAME_EN draw_text(temp_name_rect_en, @map_name_en, 1) end #-------------------------------------------------------------------------- # * Set Line Width #-------------------------------------------------------------------------- def set_line_width text_width_ch = text_size(@map_name_ch).width * 1.5 text_width_en = text_size(@map_name_en).width * 1.5 (text_width_ch >= text_width_en) ? (text_width_ch) : (text_width_en) end #-------------------------------------------------------------------------- # * Set Line Position #-------------------------------------------------------------------------- def set_line_position @line_x = (contents.width - set_line_width) / 2 @line_y = (contents.height - LINE_HEIGHT) / 2 end #-------------------------------------------------------------------------- # * Get Color 1 #-------------------------------------------------------------------------- def color1 Color.new(255, 255, 255, 255) end #-------------------------------------------------------------------------- # * Get Color 2 #-------------------------------------------------------------------------- def color2 Color.new(255, 255, 255, 0) end end [/pre] 如果再不行,试试找别的地图名脚本吧,或者,我日志上的 修改小笔记 Part.2 有改现成 Window_MapName 的双地图名, 配合 修改小笔记 Part.4 的另一种修改背景方法,可以改变背景颜色或改用背景图,不过,改默认脚本是最后不得已的手段, 能有现成脚本,您最好是用现成的,修改默认脚本很危险,一不小心可能救不回来。 若是用我日志上的修改默认地图名脚本,建议先建一个新工程去试,成功了再复制到您原来工程脚本覆盖过去。 |
|
奇怪,这不是VX脚本吗?外站srgss2整合系统里的一个脚本。 用了这脚本Fps会减... |
|
本帖最后由 j433463 于 2013-1-13 05:16 编辑 似乎是 VA 本身默认的地图名显示脚本 Window_MapName, 只是改了 super(0, 0, window_width, fitting_height(1)) 第一个 0 是 x 座标,第二个 0 是 y 座标, 那个位置大概是 super(Graphics.width - window_width, Graphics.height - fitting_height(1), window_width, fitting_height(1)) 目似还把文字显示位置改成靠右显示了 draw_text(contents.rect, $game_map.display_name, 2)
|