질문과 답변

Extra Form
bandicam 2015-10-19 02-00-11-591.jpg


bandicam 2015-10-19 02-03-17-993.jpg3




첫번째 사진과 같이 평범 png 파일의 선택지인데


두번째 사진같이 다른 사진이 하나라도 들어와버리면 저렇게 선택지가 사라져버리네요...


선택지 png사진을 우선순위로 두고싶은데 어떤 방법이 없을까요??








스크립트

#------------------------------------------------------------------------------#

#  Galv's Visual Novel Choices

#------------------------------------------------------------------------------#

#  For: RPGMAKER VX ACE

#  Version 1.9

#------------------------------------------------------------------------------#

#  2013-01-16 - Version 1.9 - Added Y offset for choice window

#  2012-11-28 - Version 1.8 - Z level setting added

#  2012-11-28 - Version 1.7 - Added compatability for some cursor scripts

#  2012-11-28 - Version 1.6 - Fixed a bug that could crash the game.

#  2012-11-28 - Version 1.5 - Added offset to change postion of cursor x and y

#  2012-11-28 - Version 1.4 - Fixed z levels and made cursor use an image

#  2012-11-27 - Version 1.3 - Fixed a bug with cancel choice selection

#  2012-11-27 - Version 1.2 - added a switch to disable script effects

#  2012-11-27 - Version 1.1 - added ability to use different image per choice

#                           - added a couple more options

#  2012-11-27 - Version 1.0 - release

#------------------------------------------------------------------------------#

#  This script overwrites the default "Show Choices" list. The choices are

#  changed so they display centered on the screen with a graphic behind each

#  of them. Made with visual novel choice selection in mind.

#------------------------------------------------------------------------------#

#  INSTRUCTIONS:

#  Copy the graphic from the demo /Graphics/System into your project.

#  Copy the script into your script list, below Materials and above Main

#

#  Some setup options below, most only need to be changed if you use your own

#  custom choice image.

#------------------------------------------------------------------------------#

#  Codes:

#------------------------------------------------------------------------------#

#  Most of the usual codes that work in messages should work in choices.

#  (eg. \V[x], \N[x], \C[x], etc. Look at message tooltip to know more.)

#

#  A new one has been added so you can change the background image for separate

#  choice options.

#

#  \B[x]

#

#  This works by adding the number x (as you put in the code above) to the end

#  of the CHOICE IMAGE file name. For example, the default choice image is:

#  "Choice.png" located in /Graphics/System/. If you put the code anywhere in

#  a choice box:  \B[3]  it will look for "Choice3.png" image in the same

#  location.

#------------------------------------------------------------------------------#

 

($imported ||= {})["Galvs_Image_Choices"] = false

module Galv_Choice

 

#------------------------------------------------------------------------------#

#  SCRIPT SETUP OPTIONS

#------------------------------------------------------------------------------#

   

  CURSOR_IMAGE = "Cursor"  # Images used to determine which option you select

  CURSOR_OPACITY = 255      # Opacity of the cursor

  CURSOR_Y_OFFSET = 0       # Nudge cursor position vertically

  CURSOR_X_OFFSET = 0       # Nudge cursor position horizontally

 

  CHOICE_IMAGE = "Choice"   # Image for each choice located in /Graphics/System

  IMAGE_Y_OFFSET = 3        # Nudge your choice image vertically if needed

  IMAGE_OPACITY = 999       # The opacity of the image

 

  CHOICE_HEIGHT = 45        # How tall each choice.

  CHOICE_ITEM_Y = 2         # Offset for choice item text

   

  CENTER_TEXT = true        # left aligned if false, centered if true

                             

  DISABLE_SWITCH = 999        # Turn this switch ON to disable this script

   

  CHOICES_Y = 40           # Y offset to move choice window up or down.

                            # useful if you use a script that creates a namebox

  CHOICES_Z = 50            # The z value of the choices window. Try changing it

                            # if pictures or other scripts appear over or under

                            # the choices window to how you like.

   

#------------------------------------------------------------------------------#

  OTHER_Y_OFFSET = 12       # May fix other cursor scripts positioning

#------------------------------------------------------------------------------#

#  SCRIPT SETUP OPTIONS

#------------------------------------------------------------------------------#

 

end

 

class Window_ChoiceList < Window_Command

 

  alias galv_choice_initialize initialize

  def initialize(message_window)

    galv_choice_initialize(message_window)

    self.z = Galv_Choice::CHOICES_Z

  end

   

  def start

    @index = 0

    setup_choices

    make_cursor

    refresh

    open

    activate

    update_placement

    update_bgs

    refresh

    select(0)

  end

   

  def make_cursor

    return if $game_switches[Galv_Choice::DISABLE_SWITCH]

    @cursor_sprite = Sprite.new

    @cursor_sprite.bitmap = Cache.system(Galv_Choice::CURSOR_IMAGE)

  end

   

  def setup_choices

    @choice_sprite = []

    if !$game_switches[Galv_Choice::DISABLE_SWITCH]

      self.opacity = 0

      get_widths

    else

      self.opacity = 255

    end

  end

   

  alias galv_choice_update_placement update_placement

  def update_placement

    if $game_switches[Galv_Choice::DISABLE_SWITCH]

      galv_choice_update_placement

    else

      self.width = [max_choice_width + 12, 96].max + padding * 4

      self.width = [width, Graphics.width].min

      self.height = contents_height + Galv_Choice::CHOICE_HEIGHT - 10

      self.x = (Graphics.width - width) / 2

       

      if @message_window.openness < 100

        self.y = Graphics.height - contents_height + item_height / 2

      elsif @message_window.y >= Graphics.height / 2

        self.y = @message_window.y - contents_height + item_height / 2 - Galv_Choice::CHOICES_Y

      else

        self.y = @message_window.y + @message_window.height + item_height / 2 + Galv_Choice::CHOICES_Y

      end

    end

  end

 

  alias galv_choice_contents_height contents_height

  def contents_height

    if $game_switches[Galv_Choice::DISABLE_SWITCH]

      galv_choice_contents_height

    else

      (item_max + 1) * item_height

    end

  end

   

  def draw_item(index)

    rect = item_rect_for_text(index)

    draw_text_ex(rect.x, rect.y, command_name(index))

    if !$game_switches[Galv_Choice::DISABLE_SWITCH]

      draw_bgs(index)

    end

  end

   

  def item_rect_for_text(index)

    rect = item_rect(index)

     

    if $game_switches[Galv_Choice::DISABLE_SWITCH]

      rect.x += 4

      rect.width -= 8

      rect

    else

      if Galv_Choice::CENTER_TEXT

        rect.x = (max_choice_width - @text_sizes.collect {|s| text_size(s).width }[index] + (padding * 3)) / 2

      else

        rect.x += 4

      end

      rect.width -= 8

      rect.y += Galv_Choice::CHOICE_ITEM_Y

      rect

    end

  end

   

  def get_widths

    @text_sizes = []

    @choice_background = []

    $game_message.choices.each_with_index do |c,i|

      @text_sizes[i] = esc_characters(c,i)

    end

  end

   

  def esc_characters(text,index)

    result = text.to_s.clone

    result.gsub!(/\\/)            { "\e" }

    result.gsub!(/\e\e/)          { "\\" }

    result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }

    result.gsub!(/\eN\[(\d+)\]/i) { $game_actors[$1.to_i].name}

    result.gsub!(/\eP\[(\d+)\]/i) {

      if $game_party.members[$1.to_i].nil?

        ""

      else

        $game_party.members[$1.to_i].name 

      end

    }

    result.gsub!(/\eG/i)          { Vocab::currency_unit }

    result.gsub!(/\eC\[(\d+)\]/i)  { "" }

    result.gsub!(/\eI\[(\d+)\]/i)  { "   " }

    result.gsub!(/\eB\[(\d+)\]/i)  { @choice_background[index] = $1.to_i }

    result.gsub!(/\eB\[(\d+)\]/i)  { "" }

    result

  end

   

  def convert_escape_characters(text)

    result = text.to_s.clone

    result.gsub!(/\\/)            { "\e" }

    result.gsub!(/\e\e/)          { "\\" }

    result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }

    result.gsub!(/\eV\[(\d+)\]/i) { $game_variables[$1.to_i] }

    result.gsub!(/\eN\[(\d+)\]/i) { actor_name($1.to_i) }

    result.gsub!(/\eP\[(\d+)\]/i) { party_member_name($1.to_i) }

    result.gsub!(/\eG/i)          { Vocab::currency_unit }

    result.gsub!(/\eB\[(\d+)\]/i)  { "" }

    result

  end

   

  def item_height

    return line_height if $game_switches[Galv_Choice::DISABLE_SWITCH]

    return Galv_Choice::CHOICE_HEIGHT

  end

   

  def item_rect(index)

    rect = Rect.new

    rect.width = item_width

    rect.height = item_height - 15

    rect.height += 15 if $game_switches[Galv_Choice::DISABLE_SWITCH]

    rect.x = index % col_max * (item_width + spacing)

    rect.y = index / col_max * item_height

    rect

  end

   

  def draw_bgs(index)

    return if @choice_sprite[index] != nil

     

    if @choice_background[index].nil?

      b = ""

    else

      b = @choice_background[index]

    end

    @choice_sprite[index] = Sprite.new

    @choice_sprite[index].bitmap = Cache.system(Galv_Choice::CHOICE_IMAGE + b.to_s)

    @choice_sprite[index].x = index % col_max * (item_width + spacing)

    @choice_sprite[index].y = index / col_max * item_height

    @choice_sprite[index].z = self.z - 2

  end

 

  def update_bgs

    @choice_sprite.each_with_index do |s,i|

      s.y = self.y + i * Galv_Choice::CHOICE_HEIGHT + Galv_Choice::IMAGE_Y_OFFSET

      s.x = (Graphics.width - s.width) / 2

      s.opacity = Galv_Choice::IMAGE_OPACITY

    end

  end

   

  def dispose_bgs

    @choice_sprite.each_with_index do |s,i|

      s.dispose

      s.bitmap.dispose

    end

    if !$game_switches[Galv_Choice::DISABLE_SWITCH]

      @cursor_sprite.dispose

      @cursor_sprite.bitmap.dispose

      @choice_sprite = []

    end

  end

   

  alias galv_choice_call_ok_handler call_ok_handler

  def call_ok_handler

    galv_choice_call_ok_handler

    dispose_bgs

  end

  alias galv_choice_call_cancel_handler call_cancel_handler

  def call_cancel_handler

    galv_choice_call_cancel_handler

    dispose_bgs

  end

   

  def update_cursor

    if $game_switches[Galv_Choice::DISABLE_SWITCH]

      super

    else

      cursor_rect.empty

      return if @cursor_sprite.nil? || @choice_sprite.nil?

      if @index < 0

        @cursor_sprite.opacity = 0

      else

        @cursor_sprite.opacity = Galv_Choice::CURSOR_OPACITY

        @cursor_sprite.x = @choice_sprite[@index].x + Galv_Choice::CURSOR_X_OFFSET

        @cursor_sprite.y = @choice_sprite[@index].y + Galv_Choice::CURSOR_Y_OFFSET

        @cursor_sprite.z = self.z - 1

        cursor_rect.y = (item_height * @index) + Galv_Choice::OTHER_Y_OFFSET

      end

    end

  end

 

end # Window_ChoiceList < Window_Command



Comment '3'
  • ?
    LDG 2015.10.19 07:56
    간단하게 그림의 표시로 우선순위를 정하면 되지 않나요? 예로 전체그림은 1번, 선택지그림은 2번 이런식으로
  • ?
    뉴리키 2015.10.19 10:17
    저 선택지가 몇번 그림인지 모르겠네요
    스크립으로 소환하는거라서
  • profile
    습작 2015.10.19 12:06
    CHOICES_Z = 50 이 값을 수정해주시면 됩니다.

List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12442
RMVXA (재등록)전역저장버그:불러오기 할 시 파일이 없는곳에서 불러올 때 불러와지는 버그 file Enlice_Shaitan 2015.10.27 222
RMMV 체크박스가 안보이는 현상 해결방법 부탁드립니다. (윈도우10) 3 file 임프R 2015.10.27 261
RMMV rpg marker mv 만들기 툴 2 드래곤규 2015.10.26 235
RMMV 로드 화면의 호출, 이동속도 상한 초과 2 최빛빛 2015.10.26 276
RMMV mv 트리거를 두개설정하는법이있나요? 3 다연 2015.10.26 226
RMVXA RPG VX ACE,아이템 제한 갯수 뛰어넘는 방법은? 키보드자판기 2015.10.25 175
RMMV 아직 일본 공식 사이트에 MV 튜토리얼은 안나왔나요? 2 asdfasdf111 2015.10.25 170
RMMV 스킬을 쓸 때 커먼이벤트 먼저 나오고 그다음 스킬이 나오게 할 수 없을까요? 반다크홈 2015.10.25 149
RMVXA rpg vx ace 클래스 데이터를 읽어오는데 실패했습니다. file 야느와르 2015.10.24 227
기타 스팀판MV 질문 좀 해봅니다. 2 Bathory 2015.10.24 181
RMVXA 여러분의 도움이 한번 더 필요합니다. 1 file 가온누리55 2015.10.23 119
RMVXA 경영게임 처럼 이벤트의 위치를 플레이어가 원하는 대로 하는 스크립트는 없나요? 1 겜제작광 2015.10.23 120
RMMV mv를 다운 했습니다. 근데... 7 무명시절 2015.10.23 314
RMVXA 아아아아아아ㅏ 짜증나 1 file 가온누리55 2015.10.23 173
RMMV 혹시 공홈에서 RPG만들기 구매하시고 환불 해보신 경험 있으신분 계신가요? 우주철거 2015.10.23 157
RMVXA bgm이 루프할때마다 조금씩 끊겨서 반복되요. 제발 도와주세요 저 간절해요 4 포포포 2015.10.22 501
RMXP 해상도 변경후 문제점 뮤러 2015.10.22 144
RMVXA 대시 사용시 스위치 작동이 되게 할 순 없나요? 1 콜라아아 2015.10.22 173
기타 이건 가능하게 되겠죠? 타락한마왕 2015.10.22 92
RMVXA 게임 클리어 보상? 1 테르니아 2015.10.22 134
Board Pagination Prev 1 ... 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 ... 516 Next
/ 516