이건 비밀님이랑 KimTJ 님이 알려줄셔서 간신히 했음. 이 스크립트는 왼쪽 아래 구석에 경험치가 하얀글씨로 나올것임.
class Game_Actor < Game_Battler
def exp_rate
if @exp_list[@level+1] - @exp_list[@level] > 0
return (@exp - @exp_list[@level]).to_f / (@exp_list[@level+1] - @exp_list[@level]).to_f
else
return 0
end
end
end
class Window_ExpRate < Window_Base
def initialize
super(178, 441, 100, 60) # <- location, size
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font = Font.new("Tahoma", 30) # <- font, size
self.opacity = 0
self.back_opacity = 0
end
def refresh
self.contents.clear
self.contents.draw_text(0, 0, 100, 30, @show_text)
end
def actor
$game_party.actors[0] # <- 파티 0번째
end
def update
super
text = sprintf("%d%", (actor.exp_rate * 100).to_i)
if @show_text != text
@show_text = text
refresh
end
end
end
class Scene_Map
alias update_before_map update
def update
update_before_map
@window_exp = Window_ExpRate.new unless @window_exp
@window_exp.update
unless $scene.is_a?(Scene_Map)
@window_exp.dispose
@window_exp = nil
end
end
end
class Game_Actor < Game_Battler
def exp_rate
if @exp_list[@level+1] - @exp_list[@level] > 0
return (@exp - @exp_list[@level]).to_f / (@exp_list[@level+1] - @exp_list[@level]).to_f
else
return 0
end
end
end
class Window_ExpRate < Window_Base
def initialize
super(178, 441, 100, 60) # <- location, size
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font = Font.new("Tahoma", 30) # <- font, size
self.opacity = 0
self.back_opacity = 0
end
def refresh
self.contents.clear
self.contents.draw_text(0, 0, 100, 30, @show_text)
end
def actor
$game_party.actors[0] # <- 파티 0번째
end
def update
super
text = sprintf("%d%", (actor.exp_rate * 100).to_i)
if @show_text != text
@show_text = text
refresh
end
end
end
class Scene_Map
alias update_before_map update
def update
update_before_map
@window_exp = Window_ExpRate.new unless @window_exp
@window_exp.update
unless $scene.is_a?(Scene_Map)
@window_exp.dispose
@window_exp = nil
end
end
end