仙剑之十里坡

标题: 显示HPSP [打印本页]

作者: BlackFeather    时间: 2010-4-11 12:07
标题: 显示HPSP
  1. # ————————————————————————————————————
  2. # 本脚本来自www.66rpg.com,转载请保留此信息
  3. # ————————————————————————————————————

  4. #==============================================================================
  5. # ■ Window_Help
  6. #------------------------------------------------------------------------------
  7. # 重新定义的内容,可以显示敌人的HP\MP百分比
  8. # 作者:carol3_柳柳
  9. #==============================================================================

  10. class Window_Help < Window_Base
  11.   def set_enemy(actor)
  12.     self.contents.clear
  13.     draw_actor_name(actor, 4, 0)
  14.     draw_actor_state(actor, 140, 0)
  15.     carol3_draw_hp_bar(actor, 284, 0)
  16.     carol3_draw_sp_bar(actor, 460, 0)
  17.     @text = nil
  18.     self.visible = true
  19.   end
  20.   def carol3_draw_hp_bar(actor, x, y, width = 128) #宽度可调
  21.     self.contents.font.color = system_color
  22.     self.contents.fill_rect(x-1, y+17, width+2,6, Color.new(0, 0, 0, 255))
  23.     w = width * actor.hp / actor.maxhp
  24.     self.contents.fill_rect(x, y+18, w,1, Color.new(255, 96, 96, 255))
  25.     self.contents.fill_rect(x, y+19, w,1, Color.new(255, 0, 0, 255))
  26.     self.contents.fill_rect(x, y+20, w,1, Color.new(128, 0, 0, 255))
  27.     self.contents.fill_rect(x, y+21, w,1, Color.new(0, 0, 0, 255))
  28.     self.contents.draw_text(x,y,128,32,$data_system.words.hp,1)
  29.     self.contents.font.color = normal_color
  30.   end
  31.   def carol3_draw_sp_bar(actor, x, y, width = 128)
  32.     self.contents.font.color = system_color
  33.     self.contents.fill_rect(x-1, y+17, width+2,6, Color.new(0, 0, 0, 255))
  34.     w = width * actor.sp / actor.maxsp
  35.     self.contents.fill_rect(x, y+18, w,1, Color.new(128, 255, 255, 255))
  36.     self.contents.fill_rect(x, y+19, w,1, Color.new(0, 255, 255, 255))
  37.     self.contents.fill_rect(x, y+20, w,1, Color.new(0, 192, 192, 255))
  38.     self.contents.fill_rect(x, y+21, w,1, Color.new(0, 128, 128, 255))
  39.     self.contents.draw_text(x,y,128,32,$data_system.words.sp,1)
  40.     self.contents.font.color = normal_color
  41.   end
  42. end
复制代码

作者: 最爱南宫煌    时间: 2010-4-11 15:55
你这个好像需要血量条的素材吧?
作者: BlackFeather    时间: 2010-4-11 16:02
不需要……
作者: 最爱南宫煌    时间: 2010-4-11 16:25
那就直接显示百分之多少?
作者: BlackFeather    时间: 2010-4-11 16:43
描绘一根棒子
作者: 最爱南宫煌    时间: 2010-4-11 22:36
就是,棒子的素材也要准备,否则不行。
作者: 残阳泪珀    时间: 2010-4-11 23:51
我记得这个不用准备素材的阿 是直接绘出来的
作者: 最爱南宫煌    时间: 2010-4-12 22:37
我记错了吗?
作者: BlackFeather    时间: 2010-4-16 17:01
就是,棒子的素材也要准备,否则不行。
最爱南宫煌 发表于 2010-4-11 02:36

描绘!




欢迎光临 仙剑之十里坡 (http://www.palslp.com/bbs/) Powered by Discuz! X2.5