기타

필드에서 마력을 출력합니다.

by 백호 posted Feb 22, 2009
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄
class Window_MP < Window_Base
  def initialize
    super(0, 0, 180, 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, 170, 30, @show_text)
  end
  def actor
    $game_party.actors[0] # <- 파티 0번째
  end
  def update
    super
    text = sprintf("EXP: %4d / %4d", actor.sp.to_s, actor.maxsp.to_s)
    if @show_text != text
      @show_text = text
      refresh
    end
  end
end

class Scene_Map
  alias update_window_mp update
  def update
    update_window_mp
    @window_mp = Window_MP.new unless @window_mp
    @window_mp.update
    unless $scene.is_a?(Scene_Map)
      @window_mp.dispose
      @window_mp = nil
    end
  end
end