질문과 답변

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 맵의 이벤트와 액터를 그림 위에 표시하기 3 file 안나카레리나 2018.08.31 262
기타 여기서 받았던 작품에 있었던 BGM 출처를 알고 싶습니다. Ringccubus 2018.08.31 64
기타 알만툴 게임 에딧 제작 질문 봉구빕스 2018.09.01 66
RMMV 특정 무기에만 이도류가 적용 가능하게 하는 방법이 뭔가요?? 2 쿄메 2018.09.01 115
RMMV 그림표시제한 100개를 넘기고 싶어요. 1 A구몽 2018.09.02 181
RMVXA Spriteset_Map 클래스에서 추가적인 비트맵을 생성해 불러온 후, 변수에 따라 다른 이미지 불러오기 3 안나카레리나 2018.09.02 75
RMVX 노트북을 바꿔서 했는데 전에 만들었던게임이 2 골리버 2018.09.02 92
RMVXA 사진을 띄우고 그위에 한장 더띄우고 싶은데 안나옵니다.. 2 Lamiassss3 2018.09.04 80
RMMV 총만들기 16 초보입니다! 2018.09.04 454
기타 혹시 맵타일중 XP맵타일크기룰 VX ACE로 바꿀방법없을까요? LWH 2018.09.06 130
알만툴2003 1.09버전 한패를 1.12버전에 부분적으로 적용하는 방법이 없을까요? 지나가던 2018.09.08 78
RMVX 캐릭터의 자동이동 설정 2 시간측정기초시계 2018.09.08 342
RMMV [자바스크립트] 메시지창이 게이지 위에 뜨게하기 6 file 몽롱하다 2018.09.09 190
RMMV 마우스 클릭 이동시 대쉬 안하고싶어요. 2 A구몽 2018.09.09 160
RMMV mv 트라이얼 연댕 2018.09.09 77
RMVXA 대사 스킵 스크립트 어떻게 적용하나요? 1 Mark.0 2018.09.10 156
RMMV 특정 좌표로 점프하게 하는 법 3 고르고르고 2018.09.11 134
RMMV [스크립트] 파티 멤버 체력 퍼센트 감소시 사망 안하게 하는방법 2 몽롱하다 2018.09.11 93
기타 VX게임을 MV로 변경해서 모바일에서 구동 가능하나요? 1 ㅣㅅㄱㄷㄱ 2018.09.12 391
RMVXA 가만히 있을 때 체력회복 1 리테 2018.09.12 116
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