| 
 
| 赞 | 2 |  
| VIP | 33 |  
| 好人卡 | 2 |  
| 积分 | 14 |  
| 经验 | 34317 |  
| 最后登录 | 2022-9-15 |  
| 在线时间 | 1705 小时 |  
 Lv3.寻梦者 
	梦石0 星屑1428 在线时间1705 小时注册时间2011-8-17帖子818 | 
| 我用了下面两个脚本,一个是地图上显示血、蓝、名字、等级;另一个是把菜单里的经验值显示变成了条形状,请问如何才能把这个经验条在地图上显示呢? 
 这个是地图显示血蓝:
 这个是经验值变成经验条:复制代码#============================================================================
#  〇 地图显示血条魔条
#              By.冰舞蝶恋
#----------------------------------------------------------------------------
#     说明:显示的文字可自由更动来达到游戏需要的效果。
#----------------------------------------------------------------------------
#     以下是作者的白痴留言,尽管无视吧!
#     啊哈哈!这可是咱第一个独立完成的脚本吖!!
#     一时无聊做的……兴许可以用在ARPG之类的地方吧。偶然看到有不少人在拿RM做
#     ARPG,又发现似乎没有(除了邪恶的fux2字眼的那个- -||b),做了个比较完善
#     的……排版不是很好看,坐标可以自己调整。
#============================================================================
#==============================================================================
# ■ Scene_Map
#------------------------------------------------------------------------------
#  处理地图画面的类。
#==============================================================================
class Scene_Map < Scene_Base
  #--------------------------------------------------------------------------
  # ● 开始处理
  #--------------------------------------------------------------------------
  def start
    super
    $game_map.refresh
    @spriteset = Spriteset_Map.new
    @message_window = Window_Message.new
    @mapz_window = Window_MapZ.new(0, 0)
  end
  #--------------------------------------------------------------------------
  # ● 结束处理
  #--------------------------------------------------------------------------
  def terminate
    super
    @mapz_window.dispose
    if $scene.is_a?(Scene_Battle)     # 切换至战斗场景的场合
      @spriteset.dispose_characters   # 隐藏角色来生成战斗背景
    end
    snapshot_for_background
    @spriteset.dispose
    @message_window.dispose
    if $scene.is_a?(Scene_Battle)     # 切换至战斗场景的场合
      perform_battle_transition       # 执行战斗渐变
    end
  end
  #--------------------------------------------------------------------------
  # ● 基本更新处理
  #--------------------------------------------------------------------------
  def update_basic
    Graphics.update                   # 更新游戏画面
    Input.update                      # 更新输入信息
    $game_map.update                  # 更新地图
    @spriteset.update                 # 更新活动块组
  end
  #--------------------------------------------------------------------------
  # ● 更新画面
  #--------------------------------------------------------------------------
  def update
    super
    $game_map.interpreter.update      # 更新解释器
    $game_map.update                  # 更新地图
    $game_player.update               # 更新主角
    $game_system.update               # 更新计时器
    @mapz_window.update
    @spriteset.update                 # 更新活动块组
    @message_window.update            # 更新信息窗口
    unless $game_message.visible      # 信息窗口显示中除外
      update_transfer_player
      update_encounter
      update_call_menu
      update_call_debug
      update_scene_change
    end
  end
end
class Window_MapZ < Window_Base
  #--------------------------------------------------------------------------
  # ● 初始化对像
  #--------------------------------------------------------------------------
  def initialize(x,y)
    super(-12, -12, 544+16,416+16)
    self.opacity = 0
    update
  end
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def update
    self.contents.clear
    $game_map.screen.pictures[1].show("头像", 0, 0, 0, 100, 100, 255, 0)
    draw_actor_hp($game_actors[1], 80+12, 0, 160)
    draw_actor_mp($game_actors[1], 80+12, 32, 160)
    self.contents.font.color = normal_color
    self.contents.draw_text(84+12, 52+8, 544, WLH, "#{$game_actors[1].name}  Lv.#{$game_actors[1].level} ")
    self.contents.font.color = system_color
    self.contents.draw_text(0+96+120+96+40, 0-4, 544, WLH, "所持金钱:")
    self.contents.draw_text(-18, 22-4, 544, WLH, "G", 2)
    self.contents.font.color = normal_color
    self.contents.draw_text(-36, 22-4, 544, WLH, $game_party.gold, 2)   
  end
end
复制代码module XRXSVDsIn3
  Width  = 80
  Height =  9
  Color1 = 20
  Color2 = 21
end
class Game_System
  attr_accessor :wide_screen
end
class Window_Base < Window
  def draw_actor_level(actor, x, y)
    if draw_exp_gauge_scene?
      w = XRXSVDsIn3::Width * ($game_system.wide_screen ? 3 : 4) / 4
      draw_actor_exp_gauge(actor, x, y, w)
    else
      w = 24
    end
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, WLH, Vocab::level_a)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 32, y, w - 32, WLH, actor.level, 2)
  end
  def draw_exp_gauge_scene?
    return [Scene_Menu, Scene_Item, Scene_Skill, Scene_Equip].include?($scene.class)
  end
  def draw_actor_exp_gauge(actor, x, y, width = 120)
    gw = width * actor.exp_percent / 100
    gc1 = text_color(XRXSVDsIn3::Color1)
    gc2 = text_color(XRXSVDsIn3::Color2)
    h   = XRXSVDsIn3::Height
    self.contents.fill_rect(x, y + WLH - h - 2, width, h, gauge_back_color)
    self.contents.gradient_fill_rect(x, y + WLH - h - 2, gw, h, gc1, gc2)
  end
end
class Game_Actor < Game_Battler
  def exp_percent
    need_next_level = @exp_list[self.level + 1] - @exp_list[self.level]
    exp_now_level   = @exp - @exp_list[self.level]
    return 100 * exp_now_level / need_next_level
  end
end
 | 
 |