질문과 답변

Extra Form

왼쪽의 액터의 얼굴칩은 제가 CG로 대체하기 위해서 크기를 늘린거구요.

 

오른쪽엔

 

이름

상태이상 유무

레벨

HP

MP

 

이렇게 있는데 이 밑에

스탯과 장비를 넣고 싶은데 루비에 대한 지식이 낮아 막히고 있습니다.

고수분들 도와주세요. ㅠㅠ

 

소스는 다음과 같습니다

 

class Scene_Menu < Scene_MenuBase
  def start
    super
    create_menu_background
    create_command_window
    create_gold_window
    create_status_window
  end
  def create_menu_background
    @menu_background = Sprite.new
    @menu_background.bitmap = Cache.system('menu_bg')
  end
  def dispose_menu_background
    @menu_background.bitmap.dispose
    @menu_background.dispose
  end
  def terminate
    super
    dispose_background
    dispose_menu_background
  end
  def create_gold_window
    @gold_window = Window_Gold.new
  end
  def create_command_window
    @command_window = Window_MenuCommand.new
    @command_window.set_handler(:item,    method(:command_item))
    @command_window.set_handler(:skill,    method(:command_personal))
    @command_window.set_handler(:equip,    method(:command_personal))
    @command_window.set_handler(:game_end,    method(:command_game_end))

    @command_window.set_handler(:cancel,    method(:return_scene))
  end
  def create_status_window
    @status_window = Window_MenuStatus.new(0, 0)
  end
end
class Window_MenuCommand < Window_Command
  def initialize
    super(480, 310)
    self.opacity = 255 if SceneManager.scene_is?(Scene_Menu)
    select_last
  end
  def window_width
    return 160
  end
  def window_height
    return 120
  end
  def make_command_list
    add_command(Vocab::item,   :item,   main_commands_enabled)
    add_command(Vocab::skill,   :skill,   main_commands_enabled)
    add_command(Vocab::equip,   :equip,   main_commands_enabled)
    add_command(Vocab::game_end,   :game_end)

  end
  def alignment
    return 1
  end
end
class Window_MenuStatus < Window_Selectable
  def initialize(x, y)
    super(x, y, window_width, window_height)
    @pending_index = -1
    self.opacity = 255 if SceneManager.scene_is?(Scene_Menu)
    refresh
  end
  def window_width
    return 480
  end
  def window_height
    return 480
  end
  def item_height
    return (height - standard_padding * 2) / 1
  end
  def draw_item(index)
    actor = $game_party.members[index]
    enabled = $game_party.battle_members.include?(actor)
    rect = item_rect(index)
    draw_item_background(index)
    draw_actor_face(actor, rect.x + 1, rect.y + 1, enabled)
    draw_actor_simple_status(actor, rect.x, rect.y)
  end
  def draw_actor_simple_status(actor, x, y)
    draw_actor_name(actor, x + 270, y + 1)
    draw_actor_level(actor, x + 338, y + 55)
    draw_actor_icons(actor, x + 298, y + 28)
    draw_actor_hp(actor, x + 270, y + 82)
    draw_actor_mp(actor, x + 270, y + 109)
  end
  def draw_face(face_name, face_index, x, y, enabled = true)
    bitmap = Cache.face(face_name)
    rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, 260, 455)
    contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
    bitmap.dispose
  end
  def draw_actor_name(actor, x, y, width = 124)
    change_color(hp_color(actor))
    draw_text(x, y, width, 24, actor.name)
  end
  def draw_actor_level(actor, x, y)
    change_color(system_color)
    draw_text(x, y, 32, line_height, Vocab::level_a)
    change_color(normal_color)
    draw_text(x + 56 - 24, y, 24, 24, actor.level, 2)
  end
  def draw_actor_icons(actor, x, y, width = 155)
    icons = (actor.state_icons + actor.buff_icons)[0, ((25/24)*width)/24]
    icons.each_with_index {|n, i| draw_icon(n, x + 24 * (i % (width / 24)), y + 24 * (i / (width / 24))) }
  end
  def draw_actor_hp(actor, x, y, width = 124)
    draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
    change_color(system_color)
    draw_text(x, y, 30, line_height, Vocab::hp_a)
    draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,
    hp_color(actor), normal_color)
    end
  def draw_actor_mp(actor, x, y, width = 124)
    draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
    change_color(system_color)
    draw_text(x, y, 30, line_height, Vocab::mp_a)
    draw_current_and_max_values(x, y, width, actor.mp, actor.mmp,
    mp_color(actor), normal_color)
  end
end
class Window_MenuActor < Window_MenuStatus
  def initialize
    super(0, 0)
    self.visible = false
  end
  def window_height
    Graphics.height
  end
end
class Window_Gold < Window_Base
  def initialize
    super(480, 430, window_width, 50)
    self.opacity = 255 if SceneManager.scene_is?(Scene_Menu)
    refresh
  end
  def window_width
    return 160
  end
  def refresh
    contents.clear
    change_color(system_color)
    draw_text(4, 0, contents_width - 8, line_height, '소지금')
    cx = text_size(currency_unit).width
    change_color(normal_color)
    draw_text(4, contents_height - line_height, contents.width - 8 - cx - 2, line_height, value, 2)
    change_color(system_color)
    draw_text(4, contents_height - line_height, contents.width - 8, line_height, currency_unit, 2)
  end
end
 

Comment '1'
  • ?
    코나별 2016.04.19 01:11

    스스로 해결했습니다.

     

      def draw_item(index)
        actor = $game_party.members[index]
        enabled = $game_party.battle_members.include?(actor)
        rect = item_rect(index)
        draw_item_background(index)
        draw_actor_face(actor, rect.x + 1, rect.y + 1, enabled)
        draw_actor_simple_status(actor, rect.x, rect.y)
        draw_actor_status(actor, x + 270, y + 111) # 출력 좌표는 알아서 맞췄습니다 여기에 actor_status의 이름으로 변수를 선언하고
      end

     

     

      def draw_actor_status(actor, x, y, width = 124)
        draw_actor_status_output(actor, x, y + line_height * 2,2) # 공격
        draw_actor_status_output(actor, x, y + line_height * 3,3) # 방어
        draw_actor_status_output(actor, x, y + line_height * 4,4) # 마력
        draw_actor_status_output(actor, x, y + line_height * 5,5) # 마방
        draw_actor_status_output(actor, x, y + line_height * 6,6) # 스피드
        draw_actor_status_output(actor, x, y + line_height * 7,7) # 행운
      end
      def draw_actor_status_output(actor, x, y, param_id)
      change_color(system_color)
      draw_text(x, y, 60, line_height, Vocab::param(param_id))
      change_color(normal_color)
      draw_text(x + 60, y, 36, line_height, actor.param(param_id), 2)
      end

    이렇게 추가해주니 에러 안뜨고 잘 나오는군요.


List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12446
RMVXA (해결) 사용한 아이템의 ID를 변수로 받고 싶습니다. 2 file 안나카레리나 2018.08.20 160
RMMV 적군 사이드뷰 도라 2018.08.22 93
RMVXA 패미컴이나 슈머패미컴풍의 메뉴 커맨드에 대해 재차 질문드립니다.(해결) 1 file 안나카레리나 2018.08.22 100
툴선택 MV는 알만툴 완전 초짜가 쓰기에는 부족한가요? 1 이나다 2018.08.23 208
기타 와다하노하라 더빙하고싶은데... ㅠㅠ 브금이 안나왕ㅛ ㅠㅠ 더빙모찌 2018.08.23 77
RMVXA RPG VX ACE 캐릭터 크기 어떻게 맞추죠?? 1 file 큐이 2018.08.24 235
게임찾기 UNR은 어디서 다운로드받나요? 1 심테 2018.08.25 891
RMVXA (해결) 메뉴 테두리와 글자의 간격 조절 1 file 안나카레리나 2018.08.25 379
RMVXA 혹시 맵 순서를 변경하는 방법이 있나요? 2 버너코코넛 2018.08.25 259
RMMV 파티상태에서 전투에 나오지 않는 방법 4 만죠메군 2018.08.25 108
RMVX 그림을 띄운상태로 움직이는법(해결) 2 시간측정기초시계 2018.08.25 91
RMVXA (해결) window_selectable 클래스에서 승계받은 몇 개의 클래스가 한 씬에서 모두 작동할 때 1 안나카레리나 2018.08.26 63
RMMV 상자가 열리는 애니메이션을 반복해서 재생하고 싶어요. 9 file 깡토 2018.08.28 471
RMVXA 상태창 스크립트에 초상화대신 일러스트 나오게 하는방법 알려주세요... 1 Lamiassss3 2018.08.28 393
RMVXA 캐릭터를 3등신 정도로 만들고싶은데... 도통모르겠습니다ㅠ 2 Lamiassss3 2018.08.29 627
RMVXA 이름입력의 처리에서 한 명이 아니라 여러명의 이름을 동시에 바꾸는 법 앨리스사마 2018.08.29 91
RMVXA 게임플레이시 해상도를 1280x 720으로 하고싶습니다. 2 Lamiassss3 2018.08.29 228
기타 rpg maker xp 캐릭터를 mv에 쓰고 싶은데요 2 BJ멜로 2018.08.30 199
RMVXA 만들다보니.. 불편해서 여쭤봅니다. 5 Lamiassss3 2018.08.30 129
RMVXA 메뉴 ui를 아예 뜯어 고칠 방법은 없는건가요? 3 Lamiassss3 2018.08.30 262
Board Pagination Prev 1 ... 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 ... 516 Next
/ 516