질문과 답변

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 전투 방식 2 file 빵씨 2013.04.03 1396
RMVXA 모듈을 txt파일로 만들어 게임상으로 불러오는 방법을 알고 싶습니다. 8 77이알 2012.09.26 1396
기타 자꾸오류가떠여 1 dkfvlwldksehltlqkf 2012.12.04 1396
RMVX vx 스크립트 오류인가 .. 충돌인가 애매하네요 4 file 간당께 2012.06.06 1397
RMVX ESC 키와 X키를 누르면 상태창이 나오는데 X는 무시하는 방법 6 행복해 2013.09.15 1397
RMVXA 타겟 표시하는 법좀 알려주세요 (VXA) file 기폭 2015.05.25 1397
RMXP 스크립트 조합 해주실 수 있나요? ㅠ 5 file 모르모트 2013.12.14 1399
RMXP 그림회전 회전 후 원상태 각도로 멈추는 법 3 석진이 2011.06.22 1400
RMXP 특정 커맨드로 액터 아머 지정에대한 질문 2 말짱꽝이지롱 2012.07.28 1400
RMVXA 스킬에 쿨타임을 넣고 싶습니다. 12 토끼토끼 2013.08.01 1400
RM2k rpg200X 뜯기방지 질문이 있어요 2 뮈르 2010.10.29 1401
GM 타이머 후 1 솔로몬 2011.01.24 1401
RMXP RTP에 대해 1 네메닷 2011.03.22 1401
RMXP 기본 전투방식에서, Active counter battle를 적용시켰는데요, Fernandez 2013.04.23 1401
RMVXA [완료] ace 턴알피지에서 몬스터 hp 보여주는 스크립트 찾습니다 8 보노노 2012.09.02 1401
RMVX 배포용 파일을 만들었는데 설치가 안 돼요. 3 아민 2011.04.07 1403
RMVXA 루비 배열 작성중 에러 2 file xzrjs 2012.09.23 1403
기타 캐릭터 일러스트가 깨지는 현상과 대화창 위로 올리는방법 7 file Luv 2014.06.22 1403
RMVX 이벤트와 이벤트가 접촉시 이벤트발동하는법.. kallat 2011.07.31 1405
기타 게임파일 복구 관련 질문입니다. ^ㅡ^;;;; 톰소여동생 2012.03.07 1405
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