질문과 답변

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 12393
RMVX 타일 적용 file 아리아리 2015.05.16 141
기타 윈7 어플로케일로 실행시 중국어 file 시스콘 2018.07.08 141
RMVX HP가 적으면 자동으로 상태변화 1 J_chisee45 2016.02.24 141
RMXP 선택지가 투명하게 뜹니다 file mch 2018.03.10 141
라이선스 기타 저작권 6 xmxmxm 2019.01.05 141
RMVXA 메뉴에서 아이템을 버리고 싶습니다. [해결] 2 위키니트러 2018.05.02 141
RMVXA 허걱님의 셀프 변수 스크립트를 쓰는데 좌표가... 무명시절 2017.06.09 141
스크립트 작성 RMMV 영어 단어 입력받았을때 대소문자를 구분하지 않는 방법이 있나요? 4 file 곱슬단발 2019.01.26 141
이벤트 작성 RMMV (MV) 하나의 이벤트를 여러군데에 넣을 수 있나요? 4 병아리모험 2022.06.17 140
RMXP [재질문]아이템의 커먼이벤트를 특정상황에만 실행되게끔 하는방법좀요... 9 랄토랄토 2018.08.08 140
RMMV 주인공이 움직이긴 움직이는데 걷는 모션이 정 자세 모션입니다 어떡하죠 4 냉낵 2018.07.28 140
RMVXA 이것저것만지다가 타일색이 이상해졌어요... 도와주세요 3 file 지나가던팬더 2017.10.02 140
RMVXA 셀프변수 스크립트 오류 5 file 바보인데 2017.07.15 140
RMMV MV 타일셋 관련 질문 드립니다. Rashiel 2017.05.20 140
RMMV 맵상에서의 기본 보행속도 변경이 궁금합니다. 흰자 2017.03.12 140
RMVXA 다른 컴퓨터는 스크립트 오류???? 도리 2016.10.21 140
RMVX 이벤트가 이벤트 위로 이동했으면 좋겠어요!! 3 file 이진주 2017.03.10 140
RMVXA 메뉴를 열때 액터의 스탯과 장비까지 나오는 문구를 출력하고 싶습니다 1 file 코나별 2016.04.18 140
RMVXA 장비 착용상태에서 이벤트 구현 질문입니다 + 이벤트 버그? 2 file AccelHacker 2016.03.01 140
RMVXA 적 능력치로 적에게 데미지 주기 2 테오드라 2016.02.11 140
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