Project1

标题: hp和sp都被挡住了 [打印本页]

作者: 825300455    时间: 2012-8-2 22:19
标题: hp和sp都被挡住了
本帖最后由 825300455 于 2012-8-2 22:20 编辑

我做了个hp、sp血槽,但hp,sp数值被挡了,我想显示在血槽前面怎么办,这是我想的[attach]124678[/attach]脚本在这里,要在哪加,我只要原处改和加,又要新添加一页的脚本我不要。
  1. #==============================================================================
  2. # ■ Window_BattleStatus
  3. #------------------------------------------------------------------------------
  4. #  显示战斗画面同伴状态的窗口。
  5. #==============================================================================

  6. class Window_BattleStatus < Window_Base
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #--------------------------------------------------------------------------
  10.   def initialize
  11.     super(0, 320, 640, 160)
  12.     self.contents = Bitmap.new(width - 32, height - 32)
  13.     @level_up_flags = [false, false, false, false]
  14.     refresh
  15.       end
  16.     end

  17.   #--------------------------------------------------------------------------
  18.   # ● 释放
  19.   #--------------------------------------------------------------------------
  20.   def dispose
  21.     super
  22.   end
  23.   
  24.   #--------------------------------------------------------------------------
  25.   # ● 设置升级标志
  26.   #     actor_index : 角色索引
  27.   #--------------------------------------------------------------------------
  28.   def level_up(actor_index)
  29.     @level_up_flags[actor_index] = true
  30.       end



  31.   #--------------------------------------------------------------------------
  32.   # ● 刷新
  33.   #--------------------------------------------------------------------------
  34.   def refresh
  35.     @item_max = $game_party.actors.size
  36.     for i in 0...$game_party.actors.size
  37.       actor = $game_party.actors[i]
  38.       actor_x = i * 160 + 4
  39.     self.contents.clear
  40.       for i in 0...$game_party.actors.size
  41.       actor = $game_party.actors[i]
  42.       actor_x = i * 160 + 4
  43.       draw_actor_name(actor, actor_x, 0)
  44.       draw_actor_hp(actor, actor_x, 32, 120)
  45.       draw_actor_sp(actor, actor_x, 32, 120)
  46.       # 处理HPBar
  47.       hpwidth = 150 * actor.hp / actor.maxhp
  48.       per = actor.hp.to_f / actor.maxhp.to_f
  49.       if per < 0.3
  50.        color = Color.new(255,0,0,150)
  51.        else
  52.        color = Color.new(255,100,100,150)
  53.      end
  54.       self.contents.fill_rect(actor_x,36,150,20,Color.new(11,11,11,150))
  55.       self.contents.fill_rect(actor_x,40,hpwidth,10,color)
  56.       # 处理SPBar
  57.       spwidth = 150 * actor.sp / actor.maxsp
  58.       self.contents.fill_rect(actor_x,76,150,20,Color.new(11,11,11,150))
  59.       self.contents.fill_rect(actor_x,80,spwidth,10, Color.new(0,0,255,150))
  60.       if @level_up_flags[i]
  61.         self.contents.font.color = normal_color
  62.         self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
  63.       else
  64.         draw_actor_state(actor, actor_x, 96)
  65.       end
  66.     end
  67.   end
  68. end
  69.   #--------------------------------------------------------------------------
  70.   # ● 刷新画面
  71.   #--------------------------------------------------------------------------
  72.   def update
  73.     super
  74.     # 主界面的不透明度下降
  75.     if $game_temp.battle_main_phase
  76.       self.contents_opacity -= 4 if self.contents_opacity > 191
  77.     else
  78.       self.contents_opacity += 4 if self.contents_opacity < 255
  79.       end
  80.     end

复制代码
dsu_plus_rewardpost_czw
作者: 825300455    时间: 2012-8-2 22:21
[attach]124680[/attach]这是我想要的效果


‘‘──825300455于2012-8-2 22:22补充以下内容:

为什么我上传不了图片

’’
作者: 灯笼菜刀王    时间: 2012-8-3 02:17
把这个脚本的45 50行的两句 插到  65行 if @level_up_flags[i]  的上面就可以
作者: 825300455    时间: 2012-8-4 16:04
万分感谢哈!电脑有点问题,过几天再给你奖励




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