질문과 답변

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 12392
RMVXA 선택지 질문설정할떄.. 1 AnT 2015.10.08 140
RMVXA 타일관련 질문 2 어쩌라고요 2015.04.28 140
RMVX RPG VX - 제자리에 있는 캐릭터들 동시에 사라지는 것과 두 캐릭터가 동시에 이동을 하는 방법 3 케진으옥 2018.02.05 140
RMVX vx 맵칩 적용법 백곰 2015.08.25 140
RMVXA 플레이어 접촉 이벤트가 멋대로 실행돼요 4 레노 2018.10.25 140
RMMV MV IOS 패키징 관련 질문 드립니다. Rashiel 2017.06.13 140
기타 RMVXA vx ace 아이템 조합 1 빨간토끼 2021.12.20 139
기타 RMVXA vx ace) iconset 가로 세로 크기 2 게임이만들고파 2021.01.03 139
이벤트 작성 RMMV 그림표시 없애는 법 1 퐁핑퐁 2019.07.06 139
이벤트 작성 RMVX 이벤트 자동 실행 4 헤헤헤 2019.04.30 139
RMMV 오프닝 1 laychel 2017.09.03 139
RMMV 맵상에서의 기본 보행속도 변경이 궁금합니다. 흰자 2017.03.12 139
RMVXA Yanfly Item Menu 스크립트 커스텀 추가하는 방법? file 몽롱하다 2016.09.11 139
RMMV 필요할때 아이템 창을 호출하는 스크립트나 플러그인 1 겜제작광 2016.09.05 139
RMVXA 이 스크립트는 어떻게 사용하나요 3 thentlr 2016.06.06 139
기타 RMMV 아이콘 적용..ㅠㅠ 2 file 쿠우쿠우0 2019.07.21 139
RMVXA ace에서 moveto 질문입니다. 4 file Sonrxnu 2016.03.10 139
맵배치 RMVXA 초보)절벽을 표현하고 싶은데 어떻게 해야될까요 5 겜만들고싶다앙 2020.08.24 139
RMVXA 캐릭터 4방향 이동에서 2방향 이동으로 바꿀수있나요? 2 구상꾼 2018.05.03 139
RMMV 스팀에서 VX bgm 사서 mv에서 쓸 수 있나요? 2 묵찌빠의찌빠 2018.06.02 139
Board Pagination Prev 1 ... 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 ... 516 Next
/ 516