幻想森林

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1619|回复: 2

关于上面那段显示地图名的脚本

[复制链接]

313

主题

1574

帖子

1万

积分

⑧专业

*永恒国度*

积分
14145
QQ
发表于 2005-1-26 23:41:05 | 显示全部楼层 |阅读模式
#==============================================================================
# ■ Window_Map_Name
#------------------------------------------------------------------------------
#  マップ名を表示するウィンドウです。
#==============================================================================
class Window_Map_Name < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期
  #--------------------------------------------------------------------------
  def initialize
    super(460, 0, 180, 64)
    self.contents = Bitmap.new(width-32, height-32)
    @showing_time = 0
    @text_color   = Color.new(255,255,  0,255)      # 地名:描写文字色
  end
  #--------------------------------------------------------------------------
  # ● テキスト設定
  # text : ウィンドウに表示する文字列
  # align : アラインメント (0..左揃え、1..中央揃え、2..右揃え)
  #--------------------------------------------------------------------------
  def set_text(text, align = 2)
    # テキストとアラインメントの少なくとも一方が前回と違っている場合
    if text != @text or align != @align
      # テキストを再描画
      self.contents.clear
      @showing_time = 100
      @text = text
      @align = align
      @actor = nil
      self.contents_opacity = 255
      x = 4
      y = 0
      self.contents.font.color = Color.new(  0,  0,  0, 192)
      self.contents.draw_text(x+2, y+2, self.width - 40, 32, "-"+text+"-",align=1)
      self.contents.font.color = Color.new( 64, 64, 64, 192)
      self.contents.draw_text(x-1, y-1, self.width - 40, 32, "-"+text+"-", align=1)
      self.contents.draw_text(x+1, y-1, self.width - 40, 32, "-"+text+"-", align=1)
      self.contents.draw_text(x-1, y+1, self.width - 40, 32, "-"+text+"-", align=1)
      self.contents.draw_text(x+1, y+1, self.width - 40, 32, "-"+text+"-", align=1)
      self.contents.font.color = @text_color
      self.contents.draw_text(x, y, self.width - 40, 32, "-"+text+"-", align=1)
    else
      @showing_time -= 1
      if @showing_time < 16
        # フェードアウトしはじめる
        self.contents_opacity = @showing_time * 16
      elsif @showing_time <= 0
        # 一定時間経過したので表示を消す
        self.contents.clear
      end
    end
    self.visible = true
  end
end
#==============================================================================
# ■ Scene_Map
#==============================================================================
class Scene_Map
  #--------------------------------------------------------------------------
  # ● メイン処理
  #--------------------------------------------------------------------------
  alias xrxs20_main main
  def main
    # 地名ウィンドウを作成
    @map_name_window = Window_Map_Name.new
    @map_name_window.opacity = 0
    # 戻す
    xrxs20_main
    # 地名ウィンドウを解放
    @map_name_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  alias xrxs20_update update
  def update
    # 地名ウィンドウの更新
    @map_name_window.set_text($game_map.name,1)
    xrxs20_update
  end
end
#==============================================================================
# ■ Scene_Title
#==============================================================================
class Scene_Title
  #--------------------------------------------------------------------------
  # ● メイン処理
  #--------------------------------------------------------------------------
  alias xrxs20_main main
  def main
    $map_infos = load_data("Data/MapInfos.rxdata" )
    for key in $map_infos.keys
      $map_infos[key] = $map_infos[key].name
    end
    xrxs20_main
  end
end
#==============================================================================
# ■ Game_Map
#==============================================================================
class Game_Map
  #--------------------------------------------------------------------------
  # ● マップ名を取得
  #--------------------------------------------------------------------------
  def name
    $map_infos[@map_id]
  end
end

为什么加入这段显示地图名的脚本后,在退出时出现“噔”的一声呢?不加时不会这样的。
感觉像系统出错那种声
[此贴子已经被作者于2005-1-26 23:42:19编辑过]
[img][/img] http://shop33698673.taobao.com被别人嫉妒,证明你优秀,嫉妒别人说明你无能
回复

使用道具 举报

carol3 该用户已被删除
发表于 2005-1-27 00:56:33 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

313

主题

1574

帖子

1万

积分

⑧专业

*永恒国度*

积分
14145
QQ
 楼主| 发表于 2005-1-31 00:11:27 | 显示全部楼层
难道这段脚本与我过不去、.........
[img][/img] http://shop33698673.taobao.com被别人嫉妒,证明你优秀,嫉妒别人说明你无能
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|幻想森林

GMT+8, 2025-6-19 05:02 , Processed in 0.011380 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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