RPGXP 스크립트
2013.09.24 08:14

대화 글씨가 한글자씩 나오는 스크립트

조회 수 1415 추천 수 0 댓글 1
?

단축키

Prev이전 문서

Next다음 문서

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

단축키

Prev이전 문서

Next다음 문서

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

#====================================================================== 
# ++ 메세지 분출해 표시 ver. 1.40 ++ 
#  Script by 파라개 
#  http://para.j-mx.com/ 
#------------------------------------------------------------------------------ 
# 분출해 표시를 하려면 , 
# 테일용 화상 「(스킨명)-top」 「(스킨명)-under」을 
# 「Graphics/Windowskins」폴더에 임포트 해 둘 필요가 있습니다. 
#------------------------------------------------------------------------------ 

# [분출해 표시의 사용법] 
# 이벤트 커멘드 「스크립트」로 「$mes_id」에 이벤트ID를 대입하는 것으로 
# 그 이벤트나무이고가 팝 하게 됩니다. 
# (기술예: $mes_id=4 ) 
# ID에-1를 대입하면 플레이어,0그리고 그 이벤트 자신. 
# nil또는""을 대입하면, 통상의 메세지 표시로 돌아옵니다. 
# 표시 위치는 이벤트 「문장 옵션」으로 변경할 수 있습니다. 
# 표시 위치에 「중앙」을 지정하면, 이벤트의 위치에 관계없이 
# 화면 중앙에 표시됩니다. 

# [이름 윈도우의 사용법] 
# 이벤트 커멘드 「스크립트」로 「$mes_name」에 문자열을 대입하는 것으로 
# 이름 윈도우를 표시합니다. 
# (기술예: $mes_name="아르시스" ) 
# 제어 문자 N[n] 를 사용하는 경우,는과 기술해 주세요. 
# (기술예: $mes_name="N[1]"  $mes_name="N[V[1]]") 
# ""또는nil을 대입하면, 비표시가 됩니다. 

# 두 개의 기능은 독립하고 있기 때문에, 각각 단체로 사용할 수 있습니다. 
#  $mes_id=(ID) + $mes_name="이름"  :분출해 표시 + 이름 윈도우 
#  $mes_id=(ID) + $mes_name=""      :분출해 표시 (이름 없음) 
#  $mes_id=nil + $mes_name="이름"  :디폴트 윈도우 + 이름 윈도우 
#  $mes_id=nil + $mes_name=""      :디폴트 윈도우 (이름 없음) 

# [메세지 표시 스피드의 변경법] 
# 이벤트 커멘드 「스크립트」로 「$mes_speed」에 수치를 대입합니다. 
# (기술예: $mes_speed=1 ) 
#============================================================================== 

module FUKI 
  
  # 스킨의 설정 
  # 윈도우 스킨과 같은 것을 사용할 때는 「""」 
  FUKI_SKIN_NAME = "001-Blue01"  # 분출해 용스킨 
  NAME_SKIN_NAME = "001-Blue01"  # 이름 표시용 스킨 
  
  # font size 
  MES_FONT_SIZE = 22    # 분출해 
  NAME_FONT_SIZE = 14  # 이름 윈도우 
  
  # 문자색 
  #( Color.new(0, 0, 0, 0)를 지정하면, 통상 문자색을 사용합니다 ) 
  FUKI_COLOR = Color.new(255, 255, 255, 255)  # 분출해 윈도우 
  NAME_COLOR = Color.new(255, 255, 255, 255)  # 이름 윈도우 
  
  # 윈도우의 투명도 
  FUKI_OPACITY = 255    # 분출해 윈도우 
  MES_OPACITY = 255    # 통상의 메세지 윈도우 
  NAME_OPACITY = 255    # 이름 윈도우 
  
  # 이름 윈도우의 상대 위치 
  NAME_SHIFT_X = 0    # 옆위치 
  NAME_SHIFT_Y = 16  # 세로 위치 
  
  # 화면상하로부터 윈도우가 초과할 때는, 
  # 자동으로 표시 위치(상하)를 체인지( true / false ) 
  POS_FIX = true 

  # 화면의 제일 구석나무이고를 조금 늦추는 
  # 모퉁이의 둥근 스킨을 사용하고 있고, 테두리의 모퉁이나무이고와 겹치는 경우에 true 로 하는 
  CORNER_SHIFT = false 
  SHIFT_PIXEL = 4  # true의 때에 늦추는 픽셀수 
  
  # 캐릭터의 세로의 사이즈 
  CHARACTOR_HEIGHT = 48 
  # 나무이고의 상대 위치(세로 위치) 
  POP_SHIFT_TOP = 0    # 표시 위치가 위 때 
  POP_SHIFT_UNDER = -16  # 표시 위치가 아래 때 
  
  # 메세지 표시 속도(숫자가 작을 정도 빠르다.0그리고 순간 표시) 
  # $mes_speed에 수치를 대입하는 것으로, 게임중으로 변경가능. 
  MES_SPEED = 1 

end 
  
#============================================================================== 
# □ Window_FukiMessage 
#============================================================================== 

class Window_FukiMessage < Window_Selectable 

  #-------------------------------------------------------------------------- 
  # ● 오브젝트 초기화 
  #-------------------------------------------------------------------------- 
  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 
    @w = 0 
    @h = 0 
    @wait = 0 
    @dx = 0 
    @dy = 0 
    $mes_speed = FUKI::MES_SPEED 
  end 
  #-------------------------------------------------------------------------- 
  # ○ 사이즈를 결정해 윈도우를 작성 
  #-------------------------------------------------------------------------- 
  def refresh_create 
    self.contents.clear 
    self.contents.font.color = normal_color 
    self.contents.font.size = FUKI::MES_FONT_SIZE 
    # 윈도우 사이즈를 취득 
    get_windowsize 
    w = @w + 32 + 8 
    h = @h * (self.contents.font.size + 10) + 26 
    # 분출해 윈도우를 작성 
    set_fukidasi(self.x, self.y, w, h) 
    # 이름 윈도우를 작성 
    set_namewindow 
    # 메세지 표시용 변수의 초기화 
    @dx = @dy = 0 
    @cursor_width = 0 
    @contents_drawing = true 
    # 순간 표시의 경우, 여기서 표시 처리 
    if $mes_speed == 0 
      # 묘화 처리를 루프 
      while $game_temp.message_text != "" 
        draw_massage 
      end 
      draw_opt_text 
      @contents_showing_end = true 
      @contents_drawing = false 
    else 
      # 한 글자씩 묘화 
      refresh_drawtext 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ○ 한 글자씩 묘화 
  #-------------------------------------------------------------------------- 
  def refresh_drawtext 
    if $game_temp.message_text != nil 
      if @wait > 0 
        @wait -= 1 
      elsif @wait == 0 
        # 묘화 처리 
        draw_massage 
        @wait = $mes_speed 
      end 
    end 
    # 묘화 종료 
    if $game_temp.message_text == "" 
      draw_opt_text 
      @contents_showing_end = true 
      @contents_drawing = false 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ○ 윈도우 사이즈를 취득 
  #-------------------------------------------------------------------------- 
  def get_windowsize 
    x = y = 0 
    @h = @w = 0 
    @cursor_width = 0 
    # 선택사항이라면 인덴트를 실시하는 
    if $game_temp.choice_start == 0 
      x = 16 
    end 
    # 표시 기다리는 메세지가 있는 경우 
    if $game_temp.message_text != nil 
    text = $game_temp.message_text.clone 
      # 제어 문자 처리 
      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" } 
      text.gsub!(/[Gg]/) { "02" } 
      # c 에 1 문자를 취득 (문자를 취득할 수 없게 될 때까지 루프) 
      while ((c = text.slice!(/./m)) != nil) 
        # 의 경우 
        if c == "00" 
          # 본래의 문자에 되돌리는 
          c = "" 
        end 
        # C[n] 또는 G 의 경우 
        if c == "01" or c == "02" 
          # 다음의 문자에 
          next 
        end 
        # 개행 문자의 경우 
        if c == "n" 
          # y 에 1 를 가산 
          y += 1 
          # 종횡 사이즈를 취득 
          @h = y 
          @w = x > @w ? x : @w 
          if y >= $game_temp.choice_start 
            @w = x + 8 > @w ? x + 8 : @w 
          end 
          x = 0 
          # 선택사항이라면 인덴트를 실시하는 
          if y >= $game_temp.choice_start 
            x = 8 
          end 
          # 다음의 문자에 
          next 
        end 
        # x 에 묘화 한 문자의 폭을 가산 
        x += self.contents.text_size(c).width 
      end 
    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] 
      @h += 1 
      x = digits_max * self.contents.font.size + 16 
      @w = x > @w ? x : @w 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ○ 묘화 처리 
  #-------------------------------------------------------------------------- 
  def draw_massage 
    self.contents.font.color = normal_color 
    # 표시 기다리는 메세지가 있는 경우 
    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 문자를 취득 
      if ((c = text.slice!(/./m)) != nil) 
        # 선택사항의 경우 
        if @dy >= $game_temp.choice_start 
          # 인덴트를 실시하는 
          @dx = 8 
          # 문자를 묘화 
          font_size = self.contents.font.size 
          self.contents.draw_text(4+@dx, (font_size+10)*@dy, font_size, font_size, c) 
          # x 에 묘화 한 문자의 폭을 가산 
          @dx += self.contents.text_size(c).width 
          # 루프 
          while ((c = text.slice!(/./m)) != "n") 
            # 문자를 묘화 
            font_size = self.contents.font.size 
            self.contents.draw_text(4+@dx, (font_size+10)*@dy, font_size, font_size, c) 
            # x 에 묘화 한 문자의 폭을 가산 
            @dx += self.contents.text_size(c).width 
          end 
          if c == "n" 
            # 커서의 폭을 갱신 
            @cursor_width = [@cursor_width, @dx].max 
            # y 에 1 를 가산 
            @dy += 1 
            @dx = 0 
          end 
          return 
        end 
        # 의 경우 
        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 
        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 
        end 
        # 개행 문자의 경우 
        if c == "n" 
          # y 에 1 를 가산 
          @dy += 1 
          @dx = 0 
        end 
        # 문자를 묘화 
        self.contents.font.size = FUKI::MES_FONT_SIZE 
        font_size = self.contents.font.size 
        self.contents.draw_text(4+@dx, (font_size+10)*@dy, font_size, font_size, c) 
        # x 에 묘화 한 문자의 폭을 가산 
        @dx += self.contents.text_size(c).width 
      end 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ○ 선택사항과 수치 입력을 유효하게 
  #-------------------------------------------------------------------------- 
  def draw_opt_text 
    # 선택사항의 경우 
    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 set_fukidasi(x, y, width, height) 
    # $mes_id 가 하늘의 때나무이고를 표시하지 않는 
    if $mes_id == nil or $mes_id == "" 
      del_fukidasi 
      reset_window 
    else 
      # 포즈 싸인을 비표시 
      self.pause = false 
      # 위치를 취득 
      pos = get_fuki_pos(width, height) 
      x = pos[0] 
      y = pos[1] 
      skin = FUKI::FUKI_SKIN_NAME != "" ? FUKI::FUKI_SKIN_NAME : $game_system.windowskin_name 
      # 분출해 용메세지 윈도우를 작성 
      self.windowskin = RPG::Cache.windowskin(skin) 
      self.x = x 
      self.y = y 
      self.height = height 
      self.width = width 
      self.contents.dispose 
      self.contents = Bitmap.new(width - 32, height - 32) 
      self.back_opacity = FUKI::FUKI_OPACITY 
      self.contents.clear 
      self.contents.font.color = normal_color 
      self.contents.font.size = FUKI::MES_FONT_SIZE 
      # 나무이고의 테일을 묘화 
      if $game_system.message_frame == 0 
        # 위치를 취득 
        tale_pos = get_tale_pos 
        @tale = Sprite.new 
        case @message_position 
          when 0  # 상 
            @tale.bitmap = RPG::Cache.windowskin(skin + "-top") 
            @tale.x = tale_pos[0] 
            @tale.y = tale_pos[1] 
            @tale.z = self.z + 1 
          when 1  # 안 
            @tale.dispose 
            @tale = nil 
          when 2  # 하 
            @tale.bitmap = RPG::Cache.windowskin(skin + "-under") 
            @tale.x = tale_pos[0] 
            @tale.y = tale_pos[1] 
            @tale.z = self.z + 1 
        end 
      end 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ○ 나무이고의 위치를 계산 
  #-------------------------------------------------------------------------- 
  def get_fuki_pos(width, height) 
    # 캐릭터를 취득 
    @character = get_character($mes_id) 
    if @character == nil 
      # 캐릭터가 존재하지 않을 때는 통상의 메세지 윈도우에 
      del_fukidasi 
      reset_window 
      return 
    end 
    # 좌표 처리 
    x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - (width / 2) 
    # 초과할 때는 화면내에 들어가도록(듯이) 이동 
    if x + width > 640 
      x = 640 - width 
    elsif x < 0 
      x = 0 
    end 
    # 윈도우의 위치를 결정 
    case $game_system.message_position 
      when 0  # 상 
        y = ( @character.real_y - $game_map.display_y + 64) * 32 / 128 - height - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP 
      when 1  # 안 
        y = (480 - height) / 2 
        x = (640 - width) / 2 
      when 2  # 하 
        y =  ( @character.real_y - $game_map.display_y + 64) * 32 / 128 + 32 + FUKI::POP_SHIFT_UNDER 
    end 
    #메세지 포지션 일시 기억 
    @message_position = $game_system.message_position 
    # 화면외에는 봐 낼 때는 윈도우의 상하를 체인지 
    if FUKI::POS_FIX 
      case @message_position 
        when 0  # 상 
          if y <= 0 
            @message_position = 2 
            y =  ( @character.real_y - $game_map.display_y + 64) * 32 / 128 + FUKI::POP_SHIFT_UNDER 
          end 
        when 2  # 하 
          if y + height >= 480 
            @message_position = 0 
            y = ( @character.real_y - $game_map.display_y + 64) * 32 / 128 - height + 32 - FUKI::CHARACTOR_HEIGHT + FUKI::POP_SHIFT_TOP 
          end 
      end 
    end 
    return [x,y] 
  end 
  #-------------------------------------------------------------------------- 
  # ○ 테일의 위치를 계산 
  #-------------------------------------------------------------------------- 
  def get_tale_pos 
    case @message_position 
      when 0  # 상 
        # 좌표 처리 
        x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16 
        # 화면단에서는 위치를 늦추는 
        if FUKI::CORNER_SHIFT 
          if x == 0 
            x = FUKI::SHIFT_PIXEL 
          elsif x == 640 - 32 
            x = 640 - 32 - FUKI::SHIFT_PIXEL 
          end 
        end 
        y = self.y + self.height - 16 
      when 1  # 중 
        x = nil 
        y = nil 
      when 2  # 하 
        # 좌표 처리 
        x = ( @character.real_x - $game_map.display_x + 64 ) * 32 / 128 - 16 
        # 화면단에서는 위치를 늦추는 
        if FUKI::CORNER_SHIFT 
          if x == 0 
            x = FUKI::SHIFT_PIXEL 
          elsif @tale.x == 640 - 32 
            x = 640 - 32 - FUKI::SHIFT_PIXEL 
          end 
        end 
        y = self.y - 16 
    end 
    return [x,y] 
  end 
  #-------------------------------------------------------------------------- 
  # ○ 이름 윈도우를 표시 
  #-------------------------------------------------------------------------- 
  def set_namewindow 
    # $mes_name 가 하늘 때는 이름 윈도우를 표시하지 않는 
    if $mes_name == nil or $mes_name == "" 
      return 
    else 
      # 변수를 세트 
      mes_name = $mes_name 
      # 제어 문자 처리 
      begin 
        last_text = mes_name.clone 
        mes_name.gsub!(/[Vv][([0-9]+)]/) { $game_variables[$1.to_i] } 
      end until mes_name == last_text 
      mes_name.gsub!(/[Nn][([0-9]+)]/) do 
        $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : "" 
      end 
      name_width = mes_name.size / 2 * FUKI::NAME_FONT_SIZE 
      name_height = FUKI::NAME_FONT_SIZE 
      name_x = self.x + FUKI::NAME_SHIFT_X 
      name_y = self.y - name_height - 16 + FUKI::NAME_SHIFT_Y 
      # 이름 윈도우(테두리만)를 작성 
      @name_win = Window_Base.new(name_x, name_y, name_width + 16, name_height + 16) 
      skin = FUKI::NAME_SKIN_NAME != "" ? FUKI::NAME_SKIN_NAME : $game_system.windowskin_name 
      @name_win.windowskin = RPG::Cache.windowskin(skin) 
      @name_win.back_opacity = FUKI::NAME_OPACITY 
      @name_win.z = self.z + 1 
      # 여백을window클래스의 한계보다 작게하기 위해(때문에), 이중구조에 
      @name_contents = Sprite.new 
      @name_contents.x = name_x + 12 
      @name_contents.y = name_y + 8 
      @name_contents.bitmap = Bitmap.new(name_width, name_height) 
      @name_contents.z = @name_win.z + 2 
      # 문자색 설정 
      nil_color = Color.new(0,0,0,0) 
      if FUKI::NAME_COLOR != nil_color 
        @name_contents.bitmap.font.color = FUKI::NAME_COLOR 
      else 
        @name_contents.bitmap.font.color = normal_color 
      end 
      @name_contents.bitmap.font.size = FUKI::NAME_FONT_SIZE 
      # 윈도우 사이즈를 조정 
      rect = @name_contents.bitmap.text_size(mes_name) 
      @name_win.width = rect.width + 32 
      # 이름을 묘화 
      @name_contents.bitmap.draw_text(rect, mes_name) 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ○ 나무이고와 이름 윈도우를 파기 
  #-------------------------------------------------------------------------- 
  def del_fukidasi 
    if @tale != nil 
      @tale.dispose 
      @tale = nil 
    end 
    if @name_win != nil 
      @name_win.dispose 
      @name_win = nil 
      @name_contents.dispose 
      @name_contents = nil 
    end 
    self.opacity = 0 
    self.x = 80 
    self.width = 480 
    self.height = 160 
    self.contents.dispose 
    self.contents = Bitmap.new(width - 32, height - 32) 
    self.pause = true 
  end 
  #-------------------------------------------------------------------------- 
  # ○ 캐릭터의 취득 
  #    parameter : 파라미터 
  #-------------------------------------------------------------------------- 
  def get_character(parameter) 
    # 파라미터로 분기 
    case parameter 
    when -1  # 플레이어 
      return $game_player 
    when 0  # 이 이벤트 
      events = $game_map.events 
      return events == nil ? nil : events[$active_event_id] 
    else  # 특정의 이벤트 
      events = $game_map.events 
      return events == nil ? nil : events[parameter] 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ● 윈도우의 위치와 불투명도의 설정 
  #-------------------------------------------------------------------------- 
  def reset_window 
    if $game_temp.in_battle 
      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 = FUKI::MES_OPACITY 
  end 
  #-------------------------------------------------------------------------- 
  # ● 프레임 갱신 
  #-------------------------------------------------------------------------- 
  def update 
    super 
    # 분출해 모드에서는 이벤트의 움직임에 추종 
    if @tale != nil 
      pos = get_fuki_pos(self.width, self.height) 
      self.x = pos[0] 
      self.y = pos[1] 
      tale_pos = get_tale_pos 
      @tale.x = tale_pos[0] 
      @tale.y = tale_pos[1] 
      if @name_win != nil 
        name_height = FUKI::NAME_FONT_SIZE 
        @name_win.x = self.x + FUKI::NAME_SHIFT_X 
        @name_win.y = self.y - name_height - 16 + FUKI::NAME_SHIFT_Y 
        @name_contents.x = @name_win.x + 12 
        @name_contents.y = @name_win.y + 8 
      end 
    end 
    # 용명의 경우 
    if @fade_in 
      self.contents_opacity += 24 
      if @name_win != nil 
        @name_win.opacity += 24 
      end 
      if @tale != nil 
        @tale.opacity += 24 
      end 
      if @input_number_window != nil 
        @input_number_window.contents_opacity += 24 
      end 
      if self.contents_opacity == 255 
        @fade_in = false 
      end 
      return 
    end 
    # 메세지 표시중의 경우 
    if @contents_drawing 
      refresh_drawtext 
      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_end 
      # 선택사항의 표시중이 아니면 포즈 싸인을 표시 
      # 분출해 모드에서는 비표시 
      if $game_temp.choice_max == 0 and @tale == nil 
        self.pause = true 
      else 
        self.pause = false 
      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 
        # 나무이고를 파기 
        del_fukidasi 
      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_create 
      if @name_win != nil 
        @name_win.opacity = 0 
      end 
      if @tale != nil 
        @tale.opacity = 0 
      end 
      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 @name_win != nil 
        @name_win.opacity -= 48 
      end 
      if @tale != nil 
        @tale.opacity -= 48 
      end 
      if self.opacity == 0 
        self.visible = false 
        @fade_out = false 
        $game_temp.message_window_showing = false 
        del_fukidasi 
      end 
      return 
    end 
  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 
    @contents_showing_end = 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 update_cursor_rect 
    if @index >= 0 
      n = $game_temp.choice_start + @index 
      font_size = self.contents.font.size 
      self.cursor_rect.set(8, n*(font_size+10)-5, @cursor_width, (font_size+10)) 
    else 
      self.cursor_rect.empty 
    end 
  end 
  #-------------------------------------------------------------------------- 
  # ● 통상 문자색 취득 
  #-------------------------------------------------------------------------- 
  def normal_color 
    # 분출해 모드시로 설정을 적용 
    if $mes_id != nil and $mes_id != "" 
      nil_color = Color.new(0,0,0,0) 
      if FUKI::FUKI_COLOR != nil_color 
        color = FUKI::FUKI_COLOR 
      else 
        color = super 
      end 
      return color 
    else 
      # 비분출해때에는 통상 문자색 
      return super 
    end 
  end 
end 

#============================================================================== 
# ■ Interpreter 
#============================================================================== 

class Interpreter 
  #-------------------------------------------------------------------------- 
  # ● 이벤트의 셋업 
  #    event_id : 이벤트 ID 
  #-------------------------------------------------------------------------- 
  alias setup_fuki setup 
  def setup(list, event_id) 
    setup_fuki(list, event_id) 
    # 전투중이 아니면 
    if !($game_temp.in_battle) 
      # 이벤트ID를 기록 
      $active_event_id = event_id 
    end 
  end 
end 

#============================================================================== 
# ■ Scene_Map 
#============================================================================== 

class Scene_Map 
  #-------------------------------------------------------------------------- 
  # ● 메인 처리 
  #-------------------------------------------------------------------------- 
  def main 
    # 스프라이트 세트를 작성 
    @spriteset = Spriteset_Map.new 
    # 메세지 윈도우를 작성 
    @message_window = Window_FukiMessage.new 
    # 트란지션 실행 
    Graphics.transition 
    # 메인 루프 
    loop do 
      # 게임 화면을 갱신 
      Graphics.update 
      # 입력 정보를 갱신 
      Input.update 
      # 프레임 갱신 
      update 
      # 화면이 바뀌면 루프를 중단 
      if $scene != self 
        break 
      end 
    end 
    # 트란지션 준비 
    Graphics.freeze 
    # 스프라이트 세트를 해방 
    @spriteset.dispose 
    # 메세지 윈도우를 해방 
    @message_window.dispose 
    # 타이틀 화면으로 전환해 안의 경우 
    if $scene.is_a?(Scene_Title) 
      # 화면을 페이드아웃 
      Graphics.transition 
      Graphics.freeze 
    end 
  end 
end 

#============================================================================== 
# ■ Window_InputNumber 
#============================================================================== 

class Window_InputNumber < Window_Base 
  #-------------------------------------------------------------------------- 
  # ● 오브젝트 초기화 
  #    digits_max : 자리수 
  #-------------------------------------------------------------------------- 
  def initialize(digits_max) 
    @digits_max = digits_max 
    @number = 0 
    # 숫자의 폭으로부터 커서의 폭을 계산 (0~9 는 등폭과 가정) 
    dummy_bitmap = Bitmap.new(32, 32) 
    dummy_bitmap.font.size = FUKI::MES_FONT_SIZE 
    @cursor_width = dummy_bitmap.text_size("0").width + 8 
    dummy_bitmap.dispose 
    super(0, 0, @cursor_width * @digits_max + 32, 64) 
    self.contents = Bitmap.new(width - 32, height - 32) 
    self.contents.font.size = FUKI::MES_FONT_SIZE 
    self.z += 9999 
    self.opacity = 0 
    @index = 0 
    refresh 
    update_cursor_rect 
  end 
end 


출처: 게임공작소

?

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수 추천 수
128 RPGXP 스크립트 일시정지 스크립트 2 청담 2013.09.29 929 0
127 RPGXP 스크립트 셀프 스위치 조작 4 청담 2013.09.29 656 0
126 RPGXP 스크립트 HBGames.ORG::Motion Blur 3 죽은노예 2013.09.27 771 0
125 RPGXP 스크립트 횡스크롤 스크립트 3  운 2013.09.27 1106 0
124 RPGXP 스크립트 FPS 표시 스크립트 7  운 2013.09.27 1166 0
123 RPGXP 스크립트 안티 렉 스크립트 2 2013.09.26 3327 1
122 RPGXP 스크립트 2D 마인크래프트 프로젝트 7 2013.09.26 3047 2
121 RPGXP 스크립트 정지 모션 스크립트 2 2013.09.26 713 1
120 RPGXP 스크립트 모든 글자에 외곽선을 넣어주는 스크립트 3 2013.09.26 808 1
119 RPGXP 스크립트 아이템 소지수 무제한 스크립트 청담 2013.09.24 1000 0
118 RPGXP 스크립트 메뉴에서 실제시간 보는 스크립트 4 청담 2013.09.24 607 0
117 RPGXP 스크립트 장비제련 스크립트 청담 2013.09.24 1024 0
116 RPGXP 스크립트 맵 이동시 로딩 그림 표시 스크립트 1 청담 2013.09.24 716 0
115 RPGXP 스크립트 커다란 그래픽 좁은 길 못지나가는 스크립트 청담 2013.09.24 866 0
114 RPGXP 스크립트 복권 스크립트 청담 2013.09.24 925 0
113 RPGXP 스크립트 창고 시스템 1 청담 2013.09.24 983 0
112 RPGXP 스크립트 레벨업시 전회복 스크립트 2 청담 2013.09.24 685 0
» RPGXP 스크립트 대화 글씨가 한글자씩 나오는 스크립트 1 청담 2013.09.24 1415 0
110 RPGXP 스크립트 간단한 여관 스크립트 1 청담 2013.09.24 909 0
109 RPGXP 스크립트 자동으로 장애물을 피해가는 스크립트 청담 2013.09.24 860 0
Board Pagination Prev 1 ... 4 5 6 7 8 9 10 11 12 13 ... 15 Next
/ 15






[개인정보취급방침] | [이용약관] | [제휴문의] | [후원창구] | [인디사이드연혁]

Copyright © 1999 - 2016 INdiSide.com/(주)씨엘쓰리디 All Rights Reserved.
인디사이드 운영자 : 천무(이지선) | kernys(김원배) | 사신지(김병국)