고급강의실

배틀창 이름 체력 레벨 좌표 변경하기

by Seed posted Jun 19, 2014
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄

다 아실거라 생각합니다만......

그래도 모르실 분을 위해......

#==============================================================================
# ■ Window_BattleStatus
#------------------------------------------------------------------------------
#  배틀 화면에서 파티 멤버의 스테이터스를 표시하는 윈도우입니다.
#==============================================================================

class Window_BattleStatus < Window_Base
  #--------------------------------------------------------------------------
  # ● 공개 인스턴스 변수
  #--------------------------------------------------------------------------
  attr_accessor :battler                  # 버틀러
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #--------------------------------------------------------------------------
  def initialize()
    super(0, 320, 640, 160)
    self.contents = Bitmap.new(width - 256, height - 32)
    @level_up_flags = [false, false, false, false]
    refresh
  end
  #-----------------------------------------------------------------
  # ● 레벨업 플래그의 설정
  #     actor_index : 액터 인덱스
  #--------------------------------------------------------------------------
  def level_up(actor_index)
    @level_up_flags[actor_index] = true
  end
  #--------------------------------------------------------------------------
  # ● 리프레쉬
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      actor_x = i * 160 + 4
      draw_actor_name(actor, actor_x + 250, 0)   << 이 부분에서 받아온 actor의 x값에 +@를 해주시면 됩니다.
      draw_actor_hp(actor, actor_x + 220, 32, 120)
      draw_actor_sp(actor, actor_x + 220, 64, 120
)
     self.contents.draw_text(actor_x + 300, 96, 120, 32, "KOSMOS")
      if @level_up_flags[i]
        self.contents.font.color = normal_color
        self.contents.draw_text(actor_x, 96, 120, 32, "LEVEL UP!")
      else
        draw_actor_state(actor, actor_x + 180, 96)
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  def update
    super
    # 메인 국면 때는 불투명도를 약간 내린다
    if $game_temp.battle_main_phase
      self.contents_opacity -= 4 if self.contents_opacity > 191
    else
      self.contents_opacity += 4 if self.contents_opacity < 255
    end
  end
end

 

배틀스테이터스 상태창 하단에 제 나름대로 메세지를 넣어봤습니다만, MP색 바뀌면 색깔이 같이 바뀌는건 많이 슬프죠......

위에 올려진 좌표는 전부 중앙에 위치되어있습니다.

나름 깔끔하다고 생각합니다.


Articles

1 2 3 4