赞 | 406 |
VIP | 0 |
好人卡 | 11 |
积分 | 390 |
经验 | 242285 |
最后登录 | 2024-11-15 |
在线时间 | 5717 小时 |
Lv5.捕梦者
- 梦石
- 0
- 星屑
- 39016
- 在线时间
- 5717 小时
- 注册时间
- 2006-11-10
- 帖子
- 6619
|
任务完成 -3-按要求只做了HP血槽(偷懒偷懒,嘿嘿)
- #----------------------------------------------
- # 图片血槽 by 灯笼菜刀王 www.66rpg.com
- # 在main前插入 并把“HP_bar.png”塞到picture文件夹内。
- #----------------------------------------------
- class Window_Base < Window
- def draw_cchp(actor, x, y)
- meter = RPG::Cache.picture("HP_bar")
- cw = meter.width
- ch = meter.height/2
- src_rect = Rect.new(0, ch, cw, ch)
- meter2 = RPG::Cache.picture("HP_bar")
- cw = meter2.width * actor.hp / actor.maxhp
- ch = meter2.height/2
- src_rect2 = Rect.new(0, 0, cw, ch)
- self.contents.blt(x, y+16, meter, src_rect)
- self.contents.blt(x, y+16, meter2, src_rect2)
- if actor.maxhp > 999
- self.contents.draw_text(x + 55,y,48,32,actor.maxhp.to_s,2)
- else
- self.contents.draw_text(x +49,y,48,32,actor.maxhp.to_s,2)
- end
- self.contents.draw_text(x+19,y,48,32,"/",2)
- self.contents.font.color = actor.hp == 0 ? knockout_color :
- actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
- self.contents.draw_text(x + 10, y, 48, 32, actor.hp.to_s, 2)
- end
- end
- #-------------------------------------------------------------------
- # 战斗状态窗口,举例 如要显示在别的地方,就用draw_cchp(actor,x,y)
- #-------------------------------------------------------------------
- class Window_BattleStatus < Window_Base
- def refresh
- self.contents.clear
- @item_max = $game_party.actors.size
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- actor_x = i * 160 + 4
- draw_actor_name(actor, actor_x, 0)
- #-------------------------------
- draw_cchp(actor,actor_x,32) #只改了这句
- #-------------------------------
- draw_actor_sp(actor, actor_x, 64, 120)
- if @level_up_flags[i]
- self.contents.font.color = normal_color
- self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
- else
- draw_actor_state(actor, actor_x, 96)
- end
- end
- end
- end
复制代码
附赠血槽图片一张 保存为png格式,并命名为HP_bar.png
|
|