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 저장 세이브파일 망가뜨리기 by RPG Advocate 3 백호 2009.02.22 2657
380 이름입력 Advanced Enter Hero Name Window by RPG Advocate 백호 2009.02.22 1168
379 장비 전투중에 장비변경 from RGSS Wiki 1 백호 2009.02.22 1988
378 이동 및 탈것 World Map & Teleporter by SephirothSpawn 2 file 백호 2009.02.22 1156
377 맵/타일 Map Extension - 맵상의 에어리어 설정, 탈것, 맵 루프 등 from RGSS Wiki 3 file 백호 2009.02.22 2708
376 메뉴 화살표 모양 셀렉트 커서 사용 2 백호 2009.02.22 2118
375 아이템 소지/구입 아이템 갯수 99개 이상 가능(약간 수정) 2 백호 2009.02.22 1103
374 메뉴 스탯올리기 시스템 (액알가능) 27 file 백호 2009.02.22 3406
373 메뉴 FF7 Menu version 3 by AcedentProne (SDK 호환) file 백호 2009.02.22 1116
372 전투 자동전투 from RPG 쯔꾸르 XP RGSS Wiki 1 file 백호 2009.02.22 2621
371 기타 현재 맵BGM을 그대로 전투 BGM으로 연결 from phylomortis.com 백호 2009.02.22 1180
370 전투 RTAB방식의 CBS 스크립트 Final-2 5 file 백호 2009.02.22 1943
369 전투 Custom Debugger, Battle Debugger by RPG Advocate file 백호 2009.02.22 1248
368 전투 SBABS v4 (A-RPG) 5 file 백호 2009.02.22 2055
367 기타 스크롤되는 파노라마(Autoscrolling Panorama) by RPG Advocate 백호 2009.02.22 993
366 기타 폰트 자동 설치 스크립트 12 file 백호 2009.02.22 2865
365 장비 장비무기가이드&쉴드방어 1 백호 2009.02.22 1179
364 키입력 한글입력기 6 백호 2009.02.22 4299
363 기타 아이디 스크립트 4 백호 2009.02.22 1761
362 상점 상점 시세 변동 스크립트 수정판 3 백호 2009.02.22 1518
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