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(0, 0, 125, 55) # <- location, size
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font = Font.new("궁서체", 16) # <- 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
그냥 윈도우 표시 안한거하고 좌표만 바꾼것,,,, ㅠㅠ
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(0, 0, 125, 55) # <- location, size
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font = Font.new("궁서체", 16) # <- 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
그냥 윈도우 표시 안한거하고 좌표만 바꾼것,,,, ㅠㅠ