VX 스크립트

메뉴
2009.02.07 17:35

GuiRPG menu시스템

조회 수 4849 추천 수 0 댓글 13
Atachment
첨부 '1'

이런식의메뉴입니다.
   

#----------------------------------------------------------------
#----------------------------------------------------------------
#                        Menu GuiRPG 1.0
#----------------------------------------------------------------
# Criado por: GuiRPG - Guilherme Santiago
# Versão: 1.0
#  
# Esse Script faz uma pequena modificação no Menu, deixando o
# Menu mais clássico, cobrindo toda a tela e mostrando informações
# Adicionais como Mapa e Tempo de Jogo
#
# Fórum: rpgmakertotal.ipbfree.com
#
# MSN: guilhermesantiagosilva@hotmail.com
#
#----------------------------------------------------------------



class Scene_Menu < Scene_Base
  
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  
  def start
    super
    create_menu_background
    create_command_window
    @status_window = Window_MenuStatus.new(0, 80)
    @window_local = Window_Local.new(120,416)
    @time = Window_Time.new(360,416)
    @gold_window = Window_Gold2.new(0, 416)
  end
  
  def terminate
    super
    dispose_menu_background
    @command_window.dispose
    @status_window.dispose
    @window_local.dispose
    @time.dispose
    @gold_window.dispose
  end
  
  def update
    super
    update_menu_background
    @command_window.update
    @status_window.update
    @gold_window.update
    @window_local.update
    @time.update

    @window_local.y -= 5
    if @window_local.y <= 366
      @window_local.y = 366
    end
    @time.y -= 5
    if @time.y <= 366
      @time.y = 366
    end
    @gold_window.y -= 5
    if @gold_window.y <= 366
      @gold_window.y = 366
    end
    
    if @command_window.active
      update_command_selection
    elsif @status_window.active
      update_actor_selection
    end
  end
  
  def create_command_window
    s1 = Vocab::item
    s2 = Vocab::skill
    s3 = Vocab::equip
    s4 = Vocab::status
    s5 = Vocab::save
    s6 = Vocab::game_end
    @command_window = Window_Command.new(544, [s1, s2, s3, s4, s5, s6],3)
    @command_window.index = @menu_index
    if $game_party.members.size == 0          
      @command_window.draw_item(0, false)    
      @command_window.draw_item(1, false)    
      @command_window.draw_item(2, false)    
      @command_window.draw_item(3, false)    
    end
    if $game_system.save_disabled            
      @command_window.draw_item(4, false)    
    end
  end
  
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0    
        $scene = Scene_Item.new
      when 1,2,3  
        start_actor_selection
      when 4      
        $scene = Scene_File.new(true, false, false)
      when 5      
        $scene = Scene_End.new
      end
    end
  end

  def start_actor_selection
    @command_window.active = false
    @status_window.active = true
    if $game_party.last_actor_index < @status_window.item_max
      @status_window.index = $game_party.last_actor_index
    else
      @status_window.index = 0
    end
  end

  def end_actor_selection
    @command_window.active = true
    @status_window.active = false
    @status_window.index = -1
  end
  
  def update_actor_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_actor_selection
    elsif Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      case @command_window.index
      when 1  
        $scene = Scene_Skill.new(@status_window.index)
      when 2
        $scene = Scene_Equip.new(@status_window.index)
      when 3  
        $scene = Scene_Status.new(@status_window.index)
      end
    end
  end
end

class Window_MenuStatus < Window_Selectable
  
  def initialize(x, y)
    super(x, y, 544, 288)
    @column_max = 2
    refresh
    self.active = false
    self.index = -1
  end

  def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    for actor in $game_party.members
      x = actor.index % @column_max * self.width/2 + 96
      y = actor.index / @column_max * 96 + WLH / 2
      draw_actor_face(actor, x - 96, y, 92)
      draw_actor_name(actor, x, y)
      draw_actor_level(actor, x + 80, y)
      draw_actor_hp(actor, x , y + WLH * 1)
      draw_actor_mp(actor, x , y + WLH * 2 - 6)
    end
  end
  
  def update_cursor
    case @index
    when -1
      self.cursor_rect.empty
    when 0, 1, 2, 3
      self.cursor_rect.set(@index % @column_max * self.width/2 - 4, index / @column_max * 96 + WLH / 2 - 4, self.width / 2 - 32 +4, 96+4)
    else
      self.cursor_rect.set(0, 0, contents.width, @item_max * 96)
    end
  end
end

class Game_Map
   attr_reader   :map_id
   def namemap  
     $name_map = load_data("Data/MapInfos.rvdata")
     $name_map[@map_id].name
   end
end

class Window_Local < Window_Base
  
    def initialize(x,y)
    super(x, y, 240, WLH + 26)
    refresh
  end
  
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(0, -8, 200, 32, "Local:")
    self.contents.font.color = normal_color
    self.contents.draw_text(59, -8, 210, 32, $game_map.namemap.to_s)
end
end

class Window_Gold2 < Window_Base
  
  def initialize(x, y)
    super(x, y, 120, WLH + 26)
    refresh
  end
    
  def refresh
    self.contents.clear
    draw_currency_value($game_party.gold, 6, -4, 80)
  end
end

class Window_Time < Window_Base
  
  def initialize(x, y)
    super(x, y, 184, WLH + 26)
    refresh
  end
  
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(0, -8, 200, 32, "Tempo:")
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    text = sprintf("%02d:%02d:%02d", hour, min, sec)
    self.contents.font.color = normal_color
    self.contents.draw_text(69, -8, 200, 32, text)
  end
  
  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
end
Comment '13'
  • ?
    쿠쿠. 2009.02.07 23:44
    그닥...
  • ?
    할렘 2009.02.08 11:26
    저도 마음에 안들지만 없는메뉴시스템이라서 그냥 올려뒀습니다.
  • ?
    허걱 2009.02.08 17:16
    전 맘에 드는데요...1인용 메뉴로 살짝 바꿔서 써도 될듯...감사합니다~
  • ?
    백년술사 2009.02.10 18:12
    맘에 들긴하지만...
    그..뭐라해야나...
    순서...?같은게 제가 원하는게 아니라...ㄳ합니다.
  • ?
    Man.... 2009.02.17 21:52
    스클크립트가 다  이쪽으로이동했네...
  • ?
    드랍 2009.06.06 12:47
    좋긴 한데 스텟배분이 없어져서...
  • ?
    mymy 2009.11.14 19:40

    드랍님 말듣고 고개돌린 1ㅅ

    이유:내게임은 스킬장착,스텟배분등등이있어서

  • ?
    VX MANIA 2010.01.29 11:19

    별 좋진 않은듯...

    하지만 약간 좋다.

  • ?
    엑셀 2010.07.23 09:35

    좋기는 좋내요...

  • ?
    포인트팡팡 2010.07.23 09:35
    축하합니다. 엑셀님은 50포인트에 당첨되셨습니다
  • ?
    김브레이커 2010.07.28 13:50

    오오 좋네요.. 만들고 있는 게임에 적용시켰습니다.

    좋은 자료 감사합니다. ㅇㅂㅇ

  • ?
    구제가능 2011.07.24 12:37

    Local 부분만 없애고 적용시켰음

  • ?
    조총병 2011.09.22 20:08

    좋습니다!


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5398
277 기타 말풍선 그림 바꾸기 6 file 허걱 2009.08.15 3565
276 기타 거리계산 스크립트 (XP가능) 7 file 허걱 2009.08.16 2848
275 기타 확장 에러 메시지 13 file 허걱 2009.08.17 2497
274 기타 스크립트로 커먼 이벤트 실행 [수정] 3 허걱 2009.08.17 2311
273 스킬 DQ특기풍스킬 - KGC 4 카르와푸딩의아틀리에 2009.08.19 3288
272 메뉴 확장 스테이터스 화면 - KGC 23 file 카르와푸딩의아틀리에 2009.08.19 5057
271 기타 범용 게이지 묘화 - KGC 14 file 카르와푸딩의아틀리에 2009.08.19 3476
270 오디오 사운드테스트 스크립트 13 file 카르와푸딩의아틀리에 2009.08.19 2106
269 이동 및 탈것 Rei Advanced Movement System 8 file 카르와푸딩의아틀리에 2009.08.19 2624
268 맵/타일 추가 맵칩 사용 - 공개 34 file 허걱 2009.08.19 6491
267 전투 Spirits System 정령 장착?이라고해야되나; 26 file 카르와푸딩의아틀리에 2009.08.19 3869
266 이동 및 탈것 Paper Mario Walk 7 file 카르와푸딩의아틀리에 2009.08.19 2697
265 HUD 아이콘 그리기 7 file 허걱 2009.08.20 4442
264 제작도구 Icon Preview Window by Woratana 8 file 허걱 2009.08.20 2891
263 기타 앞에있는 이벤트 아이디 찾기 6 허걱 2009.08.21 2091
262 기타 클리어 횟수 기록하기 8 file 허걱 2009.08.22 2729
261 전투 커먼이벤트 컷인 스크립트 15 허걱 2009.08.23 3399
260 타이틀/게임오버 Rafidelis KaHh Box 타이틀화면 20 카르와푸딩의아틀리에 2009.08.23 5004
259 이동 및 탈것 느리게 걷기 5 허걱 2009.08.23 2424
258 HUD 네비게이션 (나침반) 36 file 허걱 2009.08.25 4908
Board Pagination Prev 1 ... 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 ... 32 Next
/ 32