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 6203
481 전투 RTAB 1.15와 애드온 from 歯車の城 4 file 백호 2009.02.22 1186
480 기타 Minesweeper(지뢰찾기) by SephirothSpawn (SDK호환) 3 file 백호 2009.02.22 1363
479 기타 Monster Arena by trickster file 백호 2009.02.22 812
478 기타 Tetris Attack by trickster 1 file 백호 2009.02.22 986
477 키입력 전체키 입력 스크립트 v4 by Cybersam 5 file 백호 2009.02.22 1948
476 키입력 Keyboard Input Module v5 by Near Fantastica (SDK호환) 백호 2009.02.22 1075
475 키입력 Mouse Input Module v5 by Near Fantastica (SDK호환) 2 백호 2009.02.22 962
474 전투 Stealing/Mugging/Scanning 6.0 Final by Trickster (SDK호환) file 백호 2009.02.22 885
473 저장 Inn & Save Point System by SephirothSpawn (SDK호환) 1 file 백호 2009.02.22 811
472 스킬 Skill Requirements by SephirothSpawn (SDK호환) file 백호 2009.02.22 763
471 메뉴 혹시있나해서-_-.. 대화창에 테두리치기 스크립트 7 백호 2009.02.22 2596
470 전투 SG_Attack Break by sandgolem (SDK호환) 백호 2009.02.22 814
469 아이템 SG_Item Break by sandgolem (SDK호환) 백호 2009.02.22 898
468 스킬 SG_Skill Break by sandgolem (SDK호환) 백호 2009.02.22 772
467 기타 RM2K Facesets, Inn & Windowskin Colors by DerVVulfman@rmxp.org 1 file 백호 2009.02.22 866
466 메뉴 Advanced Command Windows by Tsunokiette file 백호 2009.02.22 1307
465 전투 [신기술 체험]액션배틀1탄 6 file 백호 2009.02.22 2767
464 기타 [신기술 체험] RPGXP 3D 9 file 백호 2009.02.22 3637
463 기타 [신기술 체험] 솔로채팅창 17 file 백호 2009.02.22 2188
462 파티 [신기술 체험] 2p파티시스템(액알) 8 file 백호 2009.02.22 3196
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