class Window_Base
#--------------------------------------------------------------------------
# * Constants
#--------------------------------------------------------------------------
Hp_Text_Colors = Color.new(255, 32, 32), Color.new(255, 64, 64)
Sp_Text_Colors = Color.new(32, 32, 255), Color.new(64, 64, 255)
#--------------------------------------------------------------------------
# * Draw HP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 144)
# Get Color
color = $game_temp.in_battle ? Hp_Text_Colors[0] : system_color
# Draw "HP" text string
self.contents.font.color = color
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
# Calculate if there is draw space for MaxHP
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
# If In Battle
if $game_temp.in_battle
# Get Color
color = Hp_Text_Colors[1]
else
# Get Color
color = actor.hp == 0 ? knockout_color : actor.hp <= actor.maxhp / 4 ?
crisis_color : normal_color
end
# Set Color
self.contents.font.color = color
# Draw HP
self.contents.font.color = Hp_Text_Colors[1]
self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
# Draw 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
#--------------------------------------------------------------------------
# * Draw SP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_sp(actor, x, y, width = 144)
# Get Color
color = $game_temp.in_battle ? Sp_Text_Colors[0] : system_color
# Draw "SP" text string
self.contents.font.color = color
self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
# Calculate if there is draw space for MaxHP
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
# If In Battle
if $game_temp.in_battle
# Get Color
color = Sp_Text_Colors[1]
else
# Get Color
color = actor.sp == 0 ? knockout_color : actor.sp <= actor.maxsp / 4 ?
crisis_color : normal_color
end
# Set Color
self.contents.font.color = color
self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
# Draw 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
class Window_Base
#--------------------------------------------------------------------------
# * Constants
#--------------------------------------------------------------------------
Hp_Text_Colors = Color.new(255, 32, 32), Color.new(255, 64, 64)
Sp_Text_Colors = Color.new(32, 32, 255), Color.new(64, 64, 255)
#--------------------------------------------------------------------------
# * Draw HP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_hp(actor, x, y, width = 144)
# Get Color
color = $game_temp.in_battle ? Hp_Text_Colors[0] : system_color
# Draw "HP" text string
self.contents.font.color = color
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
# Calculate if there is draw space for MaxHP
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
# If In Battle
if $game_temp.in_battle
# Get Color
color = Hp_Text_Colors[1]
else
# Get Color
color = actor.hp == 0 ? knockout_color : actor.hp <= actor.maxhp / 4 ?
crisis_color : normal_color
end
# Set Color
self.contents.font.color = color
self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
# Draw 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
#--------------------------------------------------------------------------
# * Draw SP
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# width : draw spot width
#--------------------------------------------------------------------------
def draw_actor_sp(actor, x, y, width = 144)
# Get Color
color = $game_temp.in_battle ? Sp_Text_Colors[0] : system_color
# Draw "SP" text string
self.contents.font.color = color
self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
# Calculate if there is draw space for MaxHP
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
# If In Battle
if $game_temp.in_battle
# Get Color
color = Sp_Text_Colors[1]
else
# Get Color
color = actor.sp == 0 ? knockout_color : actor.sp <= actor.maxsp / 4 ?
crisis_color : normal_color
end
# Set Color
self.contents.font.color = color
self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
# Draw 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