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
381 메뉴 메뉴화면 변경 스크립트 1 file 백호 2009.02.21 2769
380 메뉴 메뉴화면에 '해야 할 일' 알려주는 창 넣기 11 하진 2012.04.23 3255
379 메세지 분풀해 표시 스크립트 9 WMN 2008.03.17 2711
378 메시지 메세지 오류 수정 시스템 3 엘릭스토리안 2010.02.06 1474
377 키입력 메세지 입력 스크립트. 25 file Bera 2010.10.18 3582
376 메시지 메세지 표시 업그레이드 11 file 백호 2009.02.21 4728
375 기타 메세지를 분출해 표시 백호 2009.02.22 1169
» 기타 메세지창의 위치 변동 자동화 file 백호 2009.02.21 1138
373 메시지 메세지플러스3.1v스크립트(얼굴표시,메세지색상,속도등정하는스크립트) 8 백호 2009.02.21 4879
372 메뉴 메이플스토리처럼 메뉴를^^ 57 file 딸기님 2010.07.13 7139
371 메인화면에 별똥별 효과 6 file 아방스 2007.11.09 4217
370 기타 멤버 교체 11 file 백호 2009.02.22 2525
369 기타 명령어들 6 지존!! 2010.07.24 2288
368 기타 모험 일기 스크립트 2 file 백호 2009.02.21 1433
367 기타 모험일기 5 키라링 2009.01.18 1825
366 기타 몬스터 게이지바 턴알 22 file 키라링 2009.01.22 4015
365 기타 몬스터 도감 7 file 백호 2009.02.21 1834
364 기타 몬스터 도감 18 file 백호 2009.02.22 2667
363 기타 몬스터도감 - 개량형 ? 7 file 백호 2009.02.22 2883
362 기타 무기 개조 스크립트 file 백호 2009.02.21 1248
Board Pagination Prev 1 ... 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 ... 52 Next
/ 52