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
41 오디오 WhiteFlute - AudioEX (XP/VX/VXA) file Alkaid 2012.12.26 1257
40 메뉴 L's Simple Custom Menu #1 R2 (SDK 2.x 필요) Alkaid 2013.01.18 1229
39 저장 Woratana's Neo Save System for RMXP by LiTTleDRAgo 5 Alkaid 2013.01.19 1399
38 이동 및 탈것 RMVX dash for RMXP by PK8 2 Alkaid 2013.01.22 1196
37 기타 appletree님 요청) 화면 명암 주기 3 file 뮤바보 2013.01.31 2727
36 메시지 WhiteFlute 멀티메시지 스크립트 (XP/VX/VXA) 4 Alkaid 2013.02.05 2268
35 저장 Law's Custom Save System by The Law G14 & Night Runner 1 file Alkaid 2013.02.18 1076
34 메시지 Universal Message System 1.8.0 by ccoa 번역 4 file PerrS 2013.04.06 1739
33 키입력 No F1, F12 and Alt+Return (Kein F1, F12 und Alt+Eingabe) by cremno 습작 2013.04.19 995
32 기타 Localization by ForeverZer0, KK20 습작 2013.04.26 738
31 키입력 Key Simulator by Fantasist 4 습작 2013.05.01 1145
30 기타 Resolution Changer Ultimate by Zeus81 7 file 습작 2013.05.05 1167
29 기타 Project RGSS3 by joe5491 6 습작 2013.05.06 1970
28 전투 SRPGコンバータⅡ by AD.Bank 1 습작 2013.05.13 1774
27 메시지 Etude87_Item_Choice_XP ver.1.10 13 file 습작 2013.05.19 2187
26 메시지 FontZ by DerVVulfman Alkaid 2013.07.19 1102
25 전투 The Lycan ABS by DerVVulfman Alkaid 2013.07.22 1898
24 기타 RPG 만들기 XP의 숨겨진 모듈/클래스 재정의 스크립트 모음 1 Alkaid 2013.08.31 1913
23 전투 전투배경확장 스크립트 3 file 아미상 2013.09.15 2770
22 키입력 [xp,vx]마우스 제스쳐 스크립트 2 클로시스 2013.09.26 2297
Board Pagination Prev 1 ... 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 Next
/ 52