질문과 답변

Extra Form
1.jpg


2.jpg



적 이름에 문장옵션이 가능한가 싶어 넣어봤더니 적용되지 않고 문장옵션 부호가 그대로 출력되네요.

혹시 몬스터 이름에 문장옵션이 적용 가능하도록 수정이 가능할까요? 


아, 참고로  저 몬스터 커서 스크립트는 http://www.atelier-rgss.com/RGSS/Battle/ACE_BAT13.html  를 사용했습니다.

Comment '4'
  • profile
    9qxb6 2015.04.20 23:23
    아래의 스크립트를 한 번 써보세요.
    http://rmrk.net/index.php/topic,44810.0.html
  • ?
    에뎀이 2015.04.21 09:14
    아... 안타깝지만 안 먹히네요 ㅠ ㅠ 여전히 부호 그대로 출력이 됩니다.
  • profile
    습작 2015.04.21 10:47

    class Sprite_Battle_Cursor < Sprite
      #--------------------------------------------------------------------------
      def refresh_cursor_name
        @cursor_name_enemy = $game_temp.battle_cursor[3]
        @cursor_name.bitmap.clear
        draw_text_ex(@cursor_name.bitmap,0,0,@cursor_name_enemy.to_s)
      end
      #--------------------------------------------------------------------------
      def draw_text_ex(bitmap, x, y, text)
        reset_font_settings(bitmap)
        text = convert_escape_characters(text)
        pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(bitmap, text)}
        process_character(bitmap, text.slice!(0, 1), text, pos) until text.empty?
      end
      #--------------------------------------------------------------------------
      def reset_font_settings(bitmap)
        change_color(bitmap, normal_color)
        bitmap.font.size = Font.default_size
        bitmap.font.bold = Font.default_bold
        bitmap.font.italic = Font.default_italic
      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
      end
      #--------------------------------------------------------------------------
      def process_character(bitmap, c, text, pos)
        case c
        when "\n"
          process_new_line(bitmap, text, pos)
        when "\f"
          process_new_page(text, pos)
        when "\e"
          process_escape_character(bitmap, obtain_escape_code(text), text, pos)
        else
          process_normal_character(bitmap, c, pos)
        end
      end
      #--------------------------------------------------------------------------
      def process_new_line(bitmap, text, pos)
        pos[:x] = pos[:new_x]
        pos[:y] += pos[:height]
        pos[:height] = calc_line_height(bitmap, text)
      end
      #--------------------------------------------------------------------------
      def process_new_page(text, pos)
      end
      #--------------------------------------------------------------------------
      def obtain_escape_code(text)
        text.slice!(/^[\$\.\|\^!><\{\}\\]|^[A-Z]+/i)
      end
      #--------------------------------------------------------------------------
      def obtain_escape_param(text)
        text.slice!(/^\[\d+\]/)[/\d+/].to_i rescue 0
      end
      #--------------------------------------------------------------------------
      def process_escape_character(bitmap, code, text, pos)
        case code.upcase
        when 'C'
          change_color(bitmap, text_color(obtain_escape_param(text)))
        when 'I'
          process_draw_icon(bitmap, obtain_escape_param(text), pos)
        when '{'
          make_font_bigger(bitmap)
        when '}'
          make_font_smaller(bitmap)
        end
      end
      #--------------------------------------------------------------------------
      def process_normal_character(bitmap, c, pos)
        text_width = bitmap.text_size(c).width
        bitmap.draw_text(pos[:x], pos[:y], text_width * 2, pos[:height], c)
        pos[:x] += text_width
      end
      #--------------------------------------------------------------------------
      def change_color(bitmap, color, enabled = true)
        bitmap.font.color.set(color)
        bitmap.font.color.alpha = translucent_alpha unless enabled
      end
      #--------------------------------------------------------------------------
      def text_color(n)
        windowskin = Cache.system("Window")
        windowskin.get_pixel(64 + (n % 8) * 8, 96 + (n / 8) * 8)
      end
      #--------------------------------------------------------------------------
      def normal_color;      text_color(0);   end;
      def system_color;      text_color(16);  end;
      def crisis_color;      text_color(17);  end;
      def knockout_color;    text_color(18);  end;
      def gauge_back_color;  text_color(19);  end;
      def hp_gauge_color1;   text_color(20);  end;
      def hp_gauge_color2;   text_color(21);  end;
      def mp_gauge_color1;   text_color(22);  end;
      def mp_gauge_color2;   text_color(23);  end;
      def mp_cost_color;     text_color(23);  end;
      def power_up_color;    text_color(24);  end;
      def power_down_color;  text_color(25);  end;
      def tp_gauge_color1;   text_color(28);  end;
      def tp_gauge_color2;   text_color(29);  end;
      def tp_cost_color;     text_color(29);  end;
      #--------------------------------------------------------------------------
      def pending_color
        windowskin.get_pixel(80, 80)
      end
      #--------------------------------------------------------------------------
      def translucent_alpha
        return 160
      end
      #--------------------------------------------------------------------------
      def process_draw_icon(bitmap, icon_index, pos)
        draw_icon(bitmap, icon_index, pos[:x], pos[:y])
        pos[:x] += 24
      end
      #--------------------------------------------------------------------------
      def draw_icon(bitmap, icon_index, x, y, enabled = true)
        icon_bitmap = Cache.system("Iconset")
        rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
        bitmap.blt(x, y, icon_bitmap, rect, enabled ? 255 : translucent_alpha)
      end
      #--------------------------------------------------------------------------
      def make_font_bigger(bitmap)
        bitmap.font.size += 8 if bitmap.font.size <= 64
      end
      #--------------------------------------------------------------------------
      def make_font_smaller(bitmap)
        bitmap.font.size -= 8 if bitmap.font.size >= 16
      end
      #--------------------------------------------------------------------------
      def calc_line_height(bitmap, text, restore_font_size = true)
        result = [line_height, bitmap.font.size].max
        last_font_size = bitmap.font.size
        text.slice(/^.*$/).scan(/\e[\{\}]/).each do |esc|
          make_font_bigger(bitmap)  if esc == "\e{"
          make_font_smaller(bitmap) if esc == "\e}"
          result = [result, bitmap.font.size].max
        end
        bitmap.font.size = last_font_size if restore_font_size
        result
      end
      #--------------------------------------------------------------------------
      def line_height
        return 24
      end
      #--------------------------------------------------------------------------
    end


    이걸 추가하시면 될겁니다.

    몬스터 이름 표시 부분에서 draw_text_ex 메서드가 작동하도록 수정했습니다.

    다만, 전과 달리 몬스터 이름이 가운데 정렬은 되지 않을겁니다.

  • ?
    에뎀이 2015.04.21 11:10
    오, 마이 선샤인!!
    정말 감사드립니다. 덕분에 고민하던 문제가 해결되었어요. ^ ^

List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 21133
RMVX 마을 같은데 들어가면 오른쪽 상단에 마을이름 뜨는거 2 휴론 2014.11.04 415
RMVX 움직이는 타이틀 배경을 사용하고 싶은데 방법을 모르겠습니다. 2 슈트롱 2014.11.03 612
RMVX 이동하지 않고 그냥 열리는 문 1 휴론 2014.11.03 358
RMXP 나무지형과 캐릭터가 겹칠때 캐릭터가 나무 뒤로가야하는데 앞으로 나와버려요 lsilstar 2014.11.03 312
RM2k3 rpg2003rtp일문판 제대로 된것 좀 answntjs00 2014.11.02 609
RMVXA 리소스 매니저에 원래 있던 기존 파일을 삭제하고싶어요 2 ㅅㅇ 2014.11.01 387
RMVXA 메뉴를 열어도 타이머가 계속 흘러가게 하고싶어요, 타이머가 있을 때 메뉴(세이브)를 못 열게 하고 싶어요 2 ㅅㅇ 2014.11.01 439
RMVX RPG만들기 vx 메뉴창에서 저장과 불러오기를 제외한 나머지를 삭제하고 싶습니다. 1 다색 2014.11.01 704
RMVXA 방을 나갔다가 다시 들어왔을떄 이벤트의 새로고침을 막고 싶습니다. 2 file 가이아_ 2014.11.01 356
RMVX 아이템개수 조건분기에 대해 질문합니다! (퀘스트만들떄) 4 마인크래프트홀릭 2014.11.01 910
RMVXA 감싸기나 대리에 대해서 1 hinim22 2014.11.01 353
RMVXA [해결완료]RPG maker VX Ace 버그 수정 도와주시면 감사합니다. 3 file 가이아_ 2014.11.01 754
RMXP 게임 기본 메뉴에서 커서 이동 관련 2 THE풀잎 2014.10.30 371
RMVXA 책같은 아이템을 사용했을때 내용물을 읽을 수 있게 하는 법 2 이이잉여 2014.10.30 421
RMVXA 배경에 흑백효과를 주는 방법이 있나요? 4 q평e평rq평e평 2014.10.30 670
RMVXA [해결됨] 이동하는 이벤트를 카메라의 중점으로 하고 싶습니다. 4 위키니트러 2014.10.30 772
RMXP rpgxp 변수로 게이지바 만드는데요 hp바가 안내려 가네요 ㅠㅠ 2 file SYCN 2014.10.29 938
RMVXA 화면크기를 640*480 으로 바꾸고 나니 Khas Awesome Light Effects의 색조변경이 잘리네요 2 edju 2014.10.29 486
RMVXA 특정한 엔딩을 보고나서 타이틀 화면이 바뀌는걸 할수 있나요? 2 세인시 2014.10.28 584
RMVXA rpg vx ace 레이어 벽 1 file pray 2014.10.27 634
Board Pagination Prev 1 ... 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 ... 518 Next
/ 518