赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 552 |
最后登录 | 2012-4-11 |
在线时间 | 73 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 73 小时
- 注册时间
- 2010-8-2
- 帖子
- 148
|
本帖最后由 tyrpg 于 2011-8-18 23:38 编辑
#显示人物HP、SP、等级-tyrpg
class Window_ahsl < Window_Base
def initialize
super(0, 0, 640, 480)
self.windowskin = ()
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = Font.default_name
self.contents.font.size = 18
@renwu = $game_party.actors[0]
xianshixinxi
end
def xianshixinxi
self.contents.clear
self.contents.font.color = normal_color
dengjimingchengxianshi(@renwu, 0, 0, 170)
hpxianshi(@renwu, 0, 32)
spxianshi(@renwu, 0, 64)
end
def update
super
end
end
class Window_Base < Window
def hpxianshi(actor, x, y, width = 144)
ahp = "HP: "+"#{actor.hp}"+"/"+"#{actor.maxhp}"
self.contents.draw_text(x, y,320, 50,ahp )
self.contents.font.color = normal_color
end
def spxianshi(actor, x, y, width = 144)
asp = "SP: "+"#{actor.sp}"+"/"+"#{actor.maxsp}"
self.contents.draw_text(x, y,320, 50,asp )
self.contents.font.color = normal_color
end
def dengjimingchengxianshi(actor, x, y, width = 120)
text = "Lv:#{actor.level}"
text2 = "#{actor.name}"+" "+text
self.contents.font.color = actor.hp == 0 ? knockout_color : normal_color
self.contents.draw_text(x, y, width, 32, text2)
end
end
class Scene_Map
alias old_main main
def main
@xianshi_Window = Window_ahsl.new
old_main
@xianshi_Window.dispose
end
alias old_update update
def update
@xianshi_Window.update
old_update
end
end
|
|