赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 1088 |
最后登录 | 2012-6-12 |
在线时间 | 27 小时 |
Lv1.梦旅人 劒剋
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 27 小时
- 注册时间
- 2007-12-16
- 帖子
- 1304
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
- #==============================================================================
- # ■ 全局血条脚本
- #------------------------------------------------------------------------------
- # 作者:英雄剑堂—冰城飞狐
- # 如需转载请保留此信息!
- #==============================================================================
- # ■ Window_Base
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # ● 描绘 HP
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # width : 描画目标的宽
- #--------------------------------------------------------------------------
- def draw_actor_hp(actor, x, y, width = 144)
- self.contents.fill_rect(x-1, y+22, width+2, 4, Color.new(255,255,255,255))
- self.contents.fill_rect(x, y+23, width, 2, Color.new(0,0,0,255))
- w1 = width*actor.hp/actor.maxhp
- self.contents.fill_rect(x, y+23, w1, 1, Color.new(255,0,0,255))
- self.contents.fill_rect(x, y+24, w1, 1, Color.new(128,0,0,255))
- # 描绘字符串 "HP"
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
- # 计算描绘 MaxHP 所需的空间
- if width - 32 >= 108
- hp_x = x + width - 108
- flag = true
- elsif width - 32 >= 48
- hp_x = x + width - 48
- flag = false
- end
- # 描绘 HP
- self.contents.font.color = actor.hp == 0 ? knockout_color :
- actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
- self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
- # 描绘 MaxHP
- if flag
- self.contents.font.color = normal_color
- self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
- self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
- end
- end
- #--------------------------------------------------------------------------
- # ● 描绘 SP
- # actor : 角色
- # x : 描画目标 X 坐标
- # y : 描画目标 Y 坐标
- # width : 描画目标的宽
- #--------------------------------------------------------------------------
- def draw_actor_sp(actor, x, y, width = 144)
- self.contents.fill_rect(x-1, y+22, width+2, 4, Color.new(255,255,255,255))
- self.contents.fill_rect(x, y+23, width, 2, Color.new(0,0,0,255))
- w1 = width*actor.sp/actor.maxsp
- self.contents.fill_rect(x, y+23, w1, 1, Color.new(0,0,255,255))
- self.contents.fill_rect(x, y+24, w1, 1, Color.new(0,0,128,255))
- # 描绘字符串 "SP"
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
- # 计算描绘 MaxSP 所需的空间
- if width - 32 >= 108
- sp_x = x + width - 108
- flag = true
- elsif width - 32 >= 48
- sp_x = x + width - 48
- flag = false
- end
- # 描绘 SP
- self.contents.font.color = actor.sp == 0 ? knockout_color :
- actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
- self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
- # 描绘 MaxSP
- if flag
- self.contents.font.color = normal_color
- self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
- self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
- end
- end
- end
复制代码
不知道大家觉得怎么样??
截图:
![]()
![]() |
|