XP 스크립트

class Window_HP < 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("체력: %4d / %4d", actor.hp.to_i, actor.maxhp.to_i)
    if @show_text != text
      @show_text = text
      refresh
    end
  end
end

class Scene_Map
  alias update_window_hp update
  def update
    update_window_hp
    @window_hp = Window_HP.new unless @window_hp
    @window_hp.update
    unless $scene.is_a?(Scene_Map)
      @window_hp.dispose
      @window_hp = nil
    end
  end
end


원본은 비밀님의 경험치 %를 필드에 출력하는 소스입니다.

HP: 534/768 이런식으로 출력됩니다.


Tip & Tech. 1 : text = sprintf("체력: %4d / %4d", actor.hp.to_i, actor.maxhp.to_i)에서 'actor.hp.to_i' 와 'actor.maxhp.to_i' 를 어떤걸로 수정하느냐에 따라서 출력되는 데이터가 변경됩니다.

ex. 1) 'actor.hp.to_i' 와 'actor.maxhp.to_i'를 'actor.sp.to_i' 'actor.maxsp.to_i'로 바꿔주시면 마력이 표시됩니다.

ex. 2) 'actor.hp.to_i' 와 'actor.maxhp.to_i'를 'actor.exp_s' 'actor.next_exp_s'로 바꿔주시면 경험치가 표시됩니다. 형식은 '현재까지 쌓은 경험치' / '도달 목표 경험치' 입니다. (예 : 100 / 1024 이런식으로..)



Tip & Tech. 2 : %4d는 자릿수를 맞추기 위해서 (4자리) 수정한 것입니다. 알맞게 조절해서 사용하세요.

Who's 백호

?

이상혁입니다.

http://elab.kr

Comment '4'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
481 상점 Advanced Shop System by Alexis Hiemis 1 file Alkaid 2010.10.08 1872
480 전투 전투중의 윈도우 전부 투명화 3 file 백호 2009.02.21 1879
479 기타 무기& 방어구 레벨제한 스크립트 23 file 백호 2009.02.21 1880
478 전투 레벨 상승 화면 개조 스크립트 4 file 백호 2009.02.21 1883
477 온라인 multy-netplay 로그인창에서 비밀번호를 ***표시해주는 script~! 1 백호 2009.02.22 1889
476 메뉴 링메뉴 제대로된것..오류안나느것. 7 백호 2009.02.21 1890
475 전투 The Lycan ABS by DerVVulfman Alkaid 2013.07.22 1895
474 전투 Mr. Mo's ABS Ultimate 1.9 by DerVVulfman 2 Alkaid 2011.12.01 1900
473 기타 mog-스테이터스 업그레이드? ps인간 2009.01.23 1904
472 액터 Actor Customization 6.0.2 by Synthesize 4 file Alkaid 2010.09.17 1912
471 기타 RPG 만들기 XP의 숨겨진 모듈/클래스 재정의 스크립트 모음 1 Alkaid 2013.08.31 1912
470 [자작]일괄조작 관련 스크립트 5 나뚜루 2009.01.10 1913
469 전투 전투불능 케릭터 강제삭제 7 독도2005 2008.10.05 1918
468 그래픽 Weather Creator 1.0 by ForeverZer0 2 file Alkaid 2011.01.22 1920
467 장비 Equipment Upgrade System 1.1 by Charlie Fleed Alkaid 2010.11.18 1928
466 이동 및 탈것 자동으로 장애물을 피해가는 스크립트 13 file 백호 2009.02.22 1929
465 기타 요리스크립트 (구) 6 *ps인간 2009.01.26 1932
464 HUD 게임 플레이시 맵의 이름을 표시하는 스크립트 1 file 백호 2009.02.21 1935
463 메뉴 KGC 메뉴화면 개조 스크립트 번역 3 file 백호 2009.02.22 1941
462 전투 RTAB방식의 CBS 스크립트 Final-2 5 file 백호 2009.02.22 1943
Board Pagination Prev 1 ... 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 ... 52 Next
/ 52