XP 스크립트





그림의 2에서 보면 플레이어가 메세지창의 가려서
잘 안보이는걸 보실수 있을겁니다


애니메이션등을 사용할때 메세지창에 가려저서
잘 안보이면 이상하겠죠?

그래서 문장옵션을 일일이 지정하는데
그 번거로움을 해소 시키기위한 스크립트 입니다.


#==============================================================================
# 걾 Window_Message
#------------------------------------------------------------------------------
# ?빒뤞?렑궸럊궎긽긞긜?긙긂귻깛긤긂궳궥갃
#==============================================================================

class Window_Message < Window_Selectable
# Start
  #==========================================================================
  # 걶 믦릶궻먠믦
  #==========================================================================
    # 롥릐뚺궻됪뽋뤵Y띆뷭궕댥돷궻릶뭠댥뤵궻렄갂긽긞긜?긙긂귽깛긤긂궕뤵궸?렑궠귢귏궥갃
    UP_DW_POS = 10
# End
  #--------------------------------------------------------------------------
  # 걶 긆긳긙긃긏긣룊딖돸
  #--------------------------------------------------------------------------
  def initialize
    super(80, 304, 480, 160)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.visible = false
    self.z = 9998
    @fade_in = false
    @fade_out = false
    @contents_showing = false
    @cursor_width = 0
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # 걶 됶뺳
  #--------------------------------------------------------------------------
  def dispose
    terminate_message
    $game_temp.message_window_showing = false
    if @input_number_window != nil
      @input_number_window.dispose
    end
    super
  end
  #--------------------------------------------------------------------------
  # 걶 긽긞긜?긙뢎뿹룉뿚
  #--------------------------------------------------------------------------
  def terminate_message
    self.active = false
    self.pause = false
    self.index = -1
    self.contents.clear
    # ?렑뭷긲깋긐귩긏깏귺
    @contents_showing = false
    # 긽긞긜?긙 긓?깑긫긞긏귩뚁귆
    if $game_temp.message_proc != nil
      $game_temp.message_proc.call
    end
    # 빒뤞갂멗묖럥갂릶뭠볺쀍궸듫궥귡빾릶귩긏깏귺
    $game_temp.message_text = nil
    $game_temp.message_proc = nil
    $game_temp.choice_start = 99
    $game_temp.choice_max = 0
    $game_temp.choice_cancel_type = 0
    $game_temp.choice_proc = nil
    $game_temp.num_input_start = 99
    $game_temp.num_input_variable_id = 0
    $game_temp.num_input_digits_max = 0
    # 긕?깑긤긂귻깛긤긂귩둎뺳
    if @gold_window != nil
      @gold_window.dispose
      @gold_window = nil
    end
  end
  #--------------------------------------------------------------------------
  # 걶 깏긲깒긞긘깄
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    x = y = 0
    @cursor_width = 0
    # 멗묖럥궶귞럻돷궛귩뛱궎
    if $game_temp.choice_start == 0
      x = 8
    end
    # ?렑뫲궭궻긽긞긜?긙궕궇귡뤾뜃
    if $game_temp.message_text != nil
      text = $game_temp.message_text
      # 맕뚥빒럻룉뿚
      begin
        last_text = text.clone
        text.gsub!(/\[Vv][([0-9]+)]/) { $game_variables[$1.to_i] }
      end until text == last_text
      text.gsub!(/\[Nn][([0-9]+)]/) do
        $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
      end
      # 뺇딿뤵갂"\\" 귩 "00" 궸빾듂
      text.gsub!(/\\/) { "00" }
      # "\C" 귩 "01" 궸갂"\G" 귩 "02" 궸빾듂
      text.gsub!(/\[Cc][([0-9]+)]/) { "01[#{$1}]" }
      text.gsub!(/\[Gg]/) { "02" }
      # c 궸 1 빒럻귩롦벦 (빒럻궕롦벦궳궖궶궘궶귡귏궳깑?긵)
      while ((c = text.slice!(/./m)) != nil)
        # \ 궻뤾뜃
        if c == "00"
          # ?뿀궻빒럻궸뽣궥
          c = "\"
        end
        # C[n] 궻뤾뜃
        if c == "01"
          # 빒럻륡귩빾뛛
          text.sub!(/[([0-9]+)]/, "")
          color = $1.to_i
          if color >= 0 and color <= 7
            self.contents.font.color = text_color(color)
          end
          # 렅궻빒럻귉
          next
        end
        # G 궻뤾뜃
        if c == "02"
          # 긕?깑긤긂귻깛긤긂귩띿맟
          if @gold_window == nil
            @gold_window = Window_Gold.new
            @gold_window.x = 560 - @gold_window.width
            if $game_temp.in_battle
              @gold_window.y = 192
            else
              @gold_window.y = self.y >= 128 ? 32 : 384
            end
            @gold_window.opacity = self.opacity
            @gold_window.back_opacity = self.back_opacity
          end
          # 렅궻빒럻귉
          next
        end
        # 둂뛱빒럻궻뤾뜃
        if c == "n"
          # 멗묖럥궶귞긇??깑궻븴귩뛛륷
          if y >= $game_temp.choice_start
            @cursor_width = [@cursor_width, x].max
          end
          # y 궸 1 귩돿럁
          y += 1
          x = 0
          # 멗묖럥궶귞럻돷궛귩뛱궎
          if y >= $game_temp.choice_start
            x = 8
          end
          # 렅궻빒럻귉
          next
        end
        # 빒럻귩?됪
        self.contents.draw_text(4 + x, 32 * y, 40, 32, c)
        # x 궸?됪궢궫빒럻궻븴귩돿럁
        x += self.contents.text_size(c).width
      end
    end
    # 멗묖럥궻뤾뜃
    if $game_temp.choice_max > 0
      @item_max = $game_temp.choice_max
      self.active = true
      self.index = 0
    end
    # 릶뭠볺쀍궻뤾뜃
    if $game_temp.num_input_variable_id > 0
      digits_max = $game_temp.num_input_digits_max
      number = $game_variables[$game_temp.num_input_variable_id]
      @input_number_window = Window_InputNumber.new(digits_max)
      @input_number_window.number = number
      @input_number_window.x = self.x + 8
      @input_number_window.y = self.y + $game_temp.num_input_start * 32
    end
  end
  #--------------------------------------------------------------------------
  # 걶 긂귻깛긤긂궻댧뭫궴븉벁뼻뱗궻먠믦
  #--------------------------------------------------------------------------
  def reset_window
# Start 빾뛛
#    if $game_temp.in_battle
    # 먰벉렄궴롥릐뚺궻됪뽋뤵궳궻Y띆뷭궕UP_DW_OS댥뤵궻렄궼긽긞긜?긙긂귽깛긤긂귩뤵궸?렑
    if $game_temp.in_battle or ($game_system.message_position == 2 and $game_player.y - [$game_map.display_y  / 128 - 1, 0].max >= UP_DW_POS)
# End 빾뛛
      self.y = 16
    else
      case $game_system.message_position
      when 0  # 뤵
        self.y = 16
      when 1  # 뭷
        self.y = 160
      when 2  # 돷
        self.y = 304
      end
    end
    if $game_system.message_frame == 0
      self.opacity = 255
    else
      self.opacity = 0
    end
    self.back_opacity = 160
  end
  #--------------------------------------------------------------------------
  # 걶 긲깒??뛛륷
  #--------------------------------------------------------------------------
  def update
    super
    # 긲긃?긤귽깛궻뤾뜃
    if @fade_in
      self.contents_opacity += 24
      if @input_number_window != nil
        @input_number_window.contents_opacity += 24
      end
      if self.contents_opacity == 255
        @fade_in = false
      end
      return
    end
    # 릶뭠볺쀍뭷궻뤾뜃
    if @input_number_window != nil
      @input_number_window.update
      # 뙂믦
      if Input.trigger?(Input::C)
        $game_system.se_play($data_system.decision_se)
        $game_variables[$game_temp.num_input_variable_id] =
          @input_number_window.number
        $game_map.need_refresh = true
        # 릶뭠볺쀍긂귻깛긤긂귩됶뺳
        @input_number_window.dispose
        @input_number_window = nil
        terminate_message
      end
      return
    end
    # 긽긞긜?긙?렑뭷궻뤾뜃
    if @contents_showing
      # 멗묖럥궻?렑뭷궳궶궚귢궽??긛긖귽깛귩?렑
      if $game_temp.choice_max == 0
        self.pause = true
      end
      # 긌긿깛긜깑
      if Input.trigger?(Input::B)
        if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
          $game_system.se_play($data_system.cancel_se)
          $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
          terminate_message
        end
      end
      # 뙂믦
      if Input.trigger?(Input::C)
        if $game_temp.choice_max > 0
          $game_system.se_play($data_system.decision_se)
          $game_temp.choice_proc.call(self.index)
        end
        terminate_message
      end
      return
    end
    # 긲긃?긤귺긂긣뭷댥둖궳?렑뫲궭궻긽긞긜?긙궔멗묖럥궕궇귡뤾뜃
    if @fade_out == false and $game_temp.message_text != nil
      @contents_showing = true
      $game_temp.message_window_showing = true
      reset_window
      refresh
      Graphics.frame_reset
      self.visible = true
      self.contents_opacity = 0
      if @input_number_window != nil
        @input_number_window.contents_opacity = 0
      end
      @fade_in = true
      return
    end
    # ?렑궥귊궖긽긞긜?긙궕궶궋궕갂긂귻깛긤긂궕됀럨륉뫴궻뤾뜃
    if self.visible
      @fade_out = true
      self.opacity -= 48
      if self.opacity == 0
        self.visible = false
        @fade_out = false
        $game_temp.message_window_showing = false
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # 걶 긇??깑궻뗩?뛛륷
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index >= 0
      n = $game_temp.choice_start + @index
      self.cursor_rect.set(8, n * 32, @cursor_width, 32)
    else
      self.cursor_rect.empty
    end
  end
end
#추천 주세요~

Who's 백호

?

이상혁입니다.

http://elab.kr

Atachment
첨부 '2'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
801 기타 맵 이동시 로딩 그림 표시 14 file 백호 2009.02.21 2479
800 기타 제련시스템 수정본입니다. 3 file 백호 2009.02.21 1020
799 기타 창고 스크립트 2 백호 2009.02.21 1203
798 기타 新 무기 개조 스크립트 3 file 백호 2009.02.21 1487
797 전투 흠.. 아직도 이 스크립트가 없군요 ㅋㅋ(제가올림..) 1 file 백호 2009.02.21 3334
796 장비 전체키 이용을 위한 장비창 스크립트 백호 2009.02.21 1234
795 키입력 新전체키 스크립트(그에 따른 그림도 실려있음) 6 file 백호 2009.02.21 2255
794 메뉴 스테이터스 화면에 넥스트 표시 1 file 백호 2009.02.21 1758
793 전투 에너미 HP&SP 표시 스크립트 2 file 백호 2009.02.21 2542
792 메뉴 링메뉴+음악도입스크립트 백호 2009.02.21 1051
791 기타 게이지 3 백호 2009.02.21 1394
790 아이템 흠..몬스터도감말고 아이템도감~ 9 백호 2009.02.21 2028
789 오디오 음악 재생 스크립트 3 file 백호 2009.02.21 1140
788 기타 CG모드 도입 스크립트 file 백호 2009.02.21 1383
787 메뉴 메뉴 변경 스크립트 2 file 백호 2009.02.21 2359
786 아이템 아이템을 사용하여 기술 습득하기 (기술문서 아이템) 2 file 백호 2009.02.21 1033
785 기타 필요 경험치 직접 정하기 9 백호 2009.02.21 1407
784 미니맵 미니맵(중복률100%? 한글번역!) 17 백호 2009.02.21 3423
783 이동 및 탈것 방향키를 누름에따라 점프의 거리가 길어진다 - 출처:엑사포 의 비밀소년님과 연금술사님의 스크립트를 개량함 3 백호 2009.02.21 1234
» 기타 메세지창의 위치 변동 자동화 file 백호 2009.02.21 1138
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ... 52 Next
/ 52