질문과 답변

Extra Form

사진에 보면 숫자가 크면 글씨랑 겹치게 되는데 그 숫자를 한칸 아래로 뛰어서 표시하는 방법이있을거같은데 스크립트를 볼줄 몰라서 이렇게 질문 올립니다.

스크립트 : #==============================================================================
# ■ Window_Fame
#------------------------------------------------------------------------------
#  메뉴 화면에서 명성치를 표시하는 윈도우입니다.
#==============================================================================
#http://rainsy.tistory.com
class Window_Fame < Window_Base
  #-----------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #-----------------------------------------------------------------------------
  def initialize(x, y)
#------------------------------------------------------------------------------
# ● 커스터마이즈
#------------------------------------------------------------------------------
    @ms = "헌터포인트"  # 입력된 문자가 표시됩니다.
    @var = 6            # 입력된 숫자가 명성치로 사용됩니다.
#------------------------------------------------------------------------------
    super(x, y, 160, WLH + 32)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # ● 리프레쉬
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(0, -4, 120, 32, @ms)
    self.contents.font.color = normal_color
    self.contents.draw_text(0, -4, 120, 32, sprintf("%d", $game_variables[@var]), 2)
  end
end

 

 

  #==============================================================================
  # ■ Scene_Menu
  #------------------------------------------------------------------------------
  # 메뉴 화면의 처리를 실시하는 클래스입니다.
  #==============================================================================
  class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #     menu_index : 커멘드의 커서 초기 위치
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # ● 개시 처리
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    create_command_window
    @gold_window = Window_Gold.new(0, 360)
    @status_window = Window_MenuStatus.new(160, 0)
    @fame_window = Window_Fame.new(0, 304)
  end
  #--------------------------------------------------------------------------
  # ● 종료 처리
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @command_window.dispose
    @gold_window.dispose
    @status_window.dispose
    @fame_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    @command_window.update
    @gold_window.update
    @status_window.update
    if @command_window.active
      update_command_selection
    elsif @status_window.active
      update_actor_selection
    end
  end
  #--------------------------------------------------------------------------
  # ● 커멘드 윈도우의 작성
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::item
    s2 = Vocab::skill
    s3 = Vocab::equip
    s4 = Vocab::status
    s5 = Vocab::save
    s6 = Vocab::game_end
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
    @command_window.index = @menu_index
    if $game_party.members.size == 0          # 파티 인원수가 0 명의 경우
      @command_window.draw_item(0, false)     # 아이템을 무효화
      @command_window.draw_item(1, false)     # 스킬을 무효화
      @command_window.draw_item(2, false)     # 장비를 무효화
      @command_window.draw_item(3, false)     # 스테이터스를 무효화
    end
    if $game_system.save_disabled             # 세이브 금지의 경우
      @command_window.draw_item(4, false)     # 세이브를 무효화
    end
  end
  #--------------------------------------------------------------------------
  # ● 커멘드 선택의 갱신
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0      # 아이템
        $scene = Scene_Item.new
      when 1,2,3  # 스킬, 장비, 스테이터스
        start_actor_selection
      when 4      # 세이브
        $scene = Scene_File.new(true, false, false)
      when 5      # 게임 종료
        $scene = Scene_End.new
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 액터 선택의 개시
  #--------------------------------------------------------------------------
  def start_actor_selection
    @command_window.active = false
    @status_window.active = true
    if $game_party.last_actor_index < @status_window.item_max
      @status_window.index = $game_party.last_actor_index
    else
      @status_window.index = 0
    end
  end
  #--------------------------------------------------------------------------
  # ● 액터 선택의 종료
  #--------------------------------------------------------------------------
  def end_actor_selection
    @command_window.active = true
    @status_window.active = false
    @status_window.index = -1
  end
  #--------------------------------------------------------------------------
  # ● 액터 선택의 갱신
  #--------------------------------------------------------------------------
  def update_actor_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_actor_selection
    elsif Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      case @command_window.index
      when 1  # 스킬
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # 장비
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # 스테이터스
        $scene = Scene_Status.new(@status_window.index)
      end
    end
  end
end

 

이거인데 어떻게 바꿔야 숫자가 밑으로 내려갈까요? ㅠㅠ

Comment '2'
  • profile
    습작 2013.05.01 16:44

    class Window_Fame < Window_Base
      def initialize(x, y)
        @ms = "헌터포인트"
        @var = 6
        super(x, y - WLH, 160, WLH * 2 + 32)

        self.contents = Bitmap.new(width - 32, height - 32)
        refresh
      end
      def refresh
        self.contents.clear
        self.contents.font.color = system_color
        self.contents.draw_text(0, -4 + WLH, 120, 32, @ms)

        self.contents.font.color = normal_color
        self.contents.draw_text(0, -4, 120, 32, sprintf("%d", $game_variables[@var]), 2)
      end
    end


    수고하세요.^^
  • ?
    으은 2013.05.01 16:49
    감사합니다!!

List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12451
Board Pagination Prev 1 ... 5 Next
/ 5