VX 스크립트

11.PNG

 

이번 스크립트는 메시지가 출력될때 기본족으로 오른쪽정렬되어 출력되게 하는 스크립트입니다.

 

사용법은 스크립트만 추가시켜 주시면 적용이 됩니다. ^^

 

 

=begin
                        Arabic Reading Right to left

Author: Bulletxt
Version: 0.4
Date: 11/07/2009
=end

# this is an id switch, if ON it will reverse the letters of a word.
# example: "Hello World" will be "olleH dlroW"
REVERSE_LETTERS_OF_WORD = 1

############################## END CONFIGURATION ###############################

class Window_Message < Window_Selectable

  #--------------------------------------------------------------------------
  # * Start Message
  #--------------------------------------------------------------------------
  def start_message
    @text = ""
    for i in 0...$game_message.texts.size
      @text += "    " if i >= $game_message.choice_start
      m = $game_message.texts.shift

      m = m.split(//u).reverse.join
      m = m.split(/ /).map { |w| w.split(//u).reverse.join}.join(' ') if $game_switches[REVERSE_LETTERS_OF_WORD]
      
      #debug sentance
      #p sprintf (m)
      @text += m + "x00"

    end
    @item_max = $game_message.choice_max
    convert_special_characters
    reset_window
    new_page
  end
  
  #--------------------------------------------------------------------------
  # * New Page
  #--------------------------------------------------------------------------
  def new_page
    contents.clear
    if $game_message.face_name.empty?
      @contents_x = 512
    else
      name = $game_message.face_name
      index = $game_message.face_index
      draw_face(name, index, 416, 0)
      @contents_x = 406
    end
    @contents_y = 0
    @line_count = 0
    @show_fast = false
    @line_show_fast = false
    @pause_skip = false
    contents.font.color = text_color(0)
  end
  #--------------------------------------------------------------------------
  # * New Line
  #--------------------------------------------------------------------------
  def new_line
    if $game_message.face_name.empty?
      @contents_x = 512
    else
      @contents_x = 406
    end
    @contents_y += WLH
    @line_count += 1
    @line_show_fast = false
  end

  #--------------------------------------------------------------------------
  # * Update Message
  #--------------------------------------------------------------------------
  def update_message
    loop do
      c = @text.slice!(/./m)            # Get next text character
      case c
      when nil                          # There is no text that must be drawn
        finish_message                  # Finish update
        break
      when "x00"                       # New line
        new_line
        if @line_count >= MAX_LINE      # If line count is maximum
          unless @text.empty?           # If there is more
            self.pause = true           # Insert number input
            break
          end
        end
      when "x01"                       # C[n]  (text character color change)
        @text.sub!(/[([0-9]+)]/, "")
        contents.font.color = text_color($1.to_i)
        next
      when "x02"                       # G  (gold display)
        @gold_window.refresh
        @gold_window.open
      when "x03"                       # .  (wait 1/4 second)
        @wait_count = 15
        break
      when "x04"                       # |  (wait 1 second)
        @wait_count = 60
        break
      when "x05"                       # !  (Wait for input)
        self.pause = true
        break
      when "x06"                       # >  (Fast display ON)
        @line_show_fast = true
      when "x07"                       # <  (Fast display OFF)
        @line_show_fast = false
      when "x08"                       # ^  (No wait for input)
        @pause_skip = true
      else                              # Normal text character
        c_width = contents.text_size(c).width
        @contents_x -= c_width
        contents.draw_text(@contents_x, @contents_y, 40, WLH, c)

      end
      break unless @show_fast or @line_show_fast
    end
  end
  
end
Comment '3'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5398
377 타이틀/게임오버 메인 화면을 건너뛰고 시작하는 스크립트 14 아방스 2008.02.01 3064
376 메시지 메시지를 빠르게 넘겨주는 스크립트 3 타카나시 소라 2012.07.23 5038
375 메시지 메시지 표시 시스템 [NMS3] 31 아방스 2009.01.24 6248
» 메시지 메시지 오른쪽 정렬되어 나오는 스크립트 3 file 아방스 2009.07.12 3237
373 기타 메뉴에서 애니매이션 사용! 12 비극ㆍ 2010.04.19 3022
372 메뉴 메뉴변경 스크립트 34 아방스 2008.01.24 7937
371 메뉴 메뉴 배경화면 바꾸는 스크립트 9 독도2005 2008.03.23 4520
370 그래픽 먼가이상한데... 밤낮 변환 vx 44 작은악마 2008.03.18 3414
369 HUD 맵이름 띄우는 스크립트 입니다. 33 시에란 2008.08.16 5271
368 맵/타일 맵에 이벤트 뿌리기 입니다. 7 file 허걱 2009.01.31 3827
367 변수/스위치 맵에 변수와 스위치 설정하기.. 5 정의로운녀석 2008.07.22 1984
366 맵/타일 맵상 캐릭터 그래픽 확대 / 축소 이벤트 스크립트 6 시트르산 2010.09.10 3023
365 타이틀/게임오버 맵 타이틀 스크립트 48 아방스 2009.06.17 5547
364 HUD 맵 이름을 띠우는 스크립트 [메시지창] 24 아방스 2008.03.09 4748
363 HUD 맵 이름 스크립트 21 file 개임맨 2010.10.03 4365
362 타이틀/게임오버 맨처음 시작할때 타이틀에 게임로드칸 없애기 7 미카엘 2008.08.20 2819
361 전투 맨손 공격시 2번공격하는 스크립트 5 아방스 2008.01.24 2357
360 메뉴 매우 간단명료한 메뉴. 32 file 비극ㆍ 2010.04.23 6619
359 기타 말풍선 그림 바꾸기 6 file 허걱 2009.08.15 3562
358 키입력 마우스 시스템 Simple Mouse System (수정) 42 Incubus 2008.05.24 5693
Board Pagination Prev 1 ... 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ... 32 Next
/ 32