class Window_Base
def draw_actor_hp(actor, x, y, width = 144, text = true)
# Draw hp bar
bitmap = RPG::Cache.acms_menusprite("HP")
rect = Rect.new(x + BAR_PADDING, y, (width - 2 * BAR_PADDING) * actor.hp / actor.maxhp, bitmap.height)
self.contents.stretch_blt(rect, bitmap, Rect.new(0, 0,
bitmap.width * actor.hp / actor.maxhp, bitmap.height), opacity)
bitmap = RPG::Cache.acms_menusprite("Gauge")
rect = []
w = bitmap.width / 3
for i in 0...3
rect << Rect.new(i * w, 0, w, bitmap.height)
end
self.contents.blt(x, y, bitmap, rect[0], opacity)
i = w
while i < width - 2 * w
self.contents.blt(x + i, y, bitmap, rect[1], opacity)
i += w
end
rect[1].width = (width - 1) % w + 1
self.contents.blt(x + i, y, bitmap, rect[1], opacity)
i += (width - 1) % w + 1
self.contents.blt(x + i, y, bitmap, rect[2], opacity)
# Draw hp name
rect = self.contents.text_size($data_system.words.hp)
self.contents.draw_text(x, y + (bitmap.height - rect.height) / 2, 32, 32, $data_system.words.hp, opacity)
self.contents.font.color = Color.new(255,255,255)
sz = self.contents.font.size
self.contents.font.size = 18
self.contents.font.bold = true
self.contents.draw_text_outline(x-16, y-8, width, 32, sprintf("%4d/%4d", actor.hp, actor.maxhp),2)
self.contents.font.size = sz
self.contents.font.bold = false
return unless text
# Draw hp
# self.contents.mp_draw_text(x + 32 + 8, y, width, 32, sprintf("%4d/%4d", actor.hp, actor.maxhp),0)
end
def draw_actor_sp(actor, x, y, width = 144, text = true)
# Draw sp bar
bitmap = RPG::Cache.acms_menusprite("SP")
rect = Rect.new(x + BAR_PADDING, y, (width - 2 * BAR_PADDING) * actor.sp / actor.maxsp, bitmap.height)
self.contents.stretch_blt(rect, bitmap, Rect.new(0, 0,
bitmap.width * actor.sp / actor.maxsp, bitmap.height), opacity)
bitmap = RPG::Cache.acms_menusprite("Gauge")
rect = []
w = bitmap.width / 3
for i in 0...3
rect << Rect.new(i * w, 0, w, bitmap.height)
end
self.contents.blt(x, y, bitmap, rect[0], opacity)
i = w
while i < width - 2 * w
self.contents.blt(x + i, y, bitmap, rect[1], opacity)
i += w
end
rect[1].width = (width - 1) % w + 1
self.contents.blt(x + i, y, bitmap, rect[1], opacity)
i += (width - 1) % w + 1
self.contents.blt(x + i, y, bitmap, rect[2], opacity)
# Draw sp name
rect = self.contents.text_size($data_system.words.sp)
self.contents.draw_text(x, y + (bitmap.height - rect.height) / 2, 32, 32, $data_system.words.sp, opacity)
self.contents.font.color = Color.new(255,255,255)
sz = self.contents.font.size
self.contents.font.size = 18
self.contents.font.bold = true
self.contents.draw_text_outline(x-16, y-8, width, 32, sprintf("%4d/%4d", actor.sp, actor.maxsp),2)
self.contents.font.bold = false
self.contents.font.size = sz
#return unless text
# Draw sp
end
end
class Bitmap
def draw_text_outline(x,y,w,h,s,align=0)
c = font.color.dup
font.color = Color.new(0,0,0)
draw_text(x, y+1 ,w ,h,s,align)
draw_text(x+2,y+1 ,w,h,s,align)
draw_text(x+1,y ,w,h ,s,align)
draw_text(x+1,y+2 ,w,h,s,align)
font.color = c
mp_draw_text(x+1, y+1 ,w,h,s,align)
end
end
class Window_Status < Window_Base
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
draw_actor_graphic(@actor, 16, 48)
draw_actor_name(@actor, 40, 0)
#draw_actor_class(@actor, 160, 0)
draw_actor_level(@actor, 160, 0)
draw_actor_state(@actor, 224, 0)
draw_actor_hp(@actor, 64, 44, 192, true)
draw_actor_sp(@actor, 64, 64, 192, true)
self.contents.font.color = system_color
self.contents.draw_text(0, 88, 40, 32, "EXP")
self.contents.draw_text(128, 88, 40, 32, "NEXT")
self.contents.font.color = normal_color
self.contents.draw_text(24, 88, 80, 32, @actor.exp_s, 2)
self.contents.draw_text(152, 88, 80, 32, @actor.next_rest_exp_s, 2)
draw_actor_parameter(@actor, 0, 120, 0)
draw_actor_parameter(@actor, 0, 144, 1)
draw_actor_parameter(@actor, 0, 168, 2)
draw_actor_parameter(@actor, 0, 192, 3)
draw_actor_parameter(@actor, 0, 216, 4)
draw_actor_parameter(@actor, 0, 240, 5)
draw_actor_parameter(@actor, 0, 264, 6)
draw_item_name($data_weapons[@actor.weapon_id], 120, 120, 136)
draw_item_name($data_armors[@actor.armor1_id], 120, 152, 136)
draw_item_name($data_armors[@actor.armor2_id], 120, 184, 136)
draw_item_name($data_armors[@actor.armor3_id], 120, 216, 136)
draw_item_name($data_armors[@actor.armor4_id], 120, 248, 136)
end
end