XP 스크립트

  RMXP SDK 1.x, 2.x와 RMVX를 참조하여 대충 만들어 본 Scene_Base입니다.  (개인적으로는 오브젝트 자동 업데이트와 자동처리가 있는 SDK 2.x의 Scene_Base가 쓰기 편합니다만) 

 

#Simple Scene_Base

class Scene_Base
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    main_variable
    main_spriteset
    main_window
    main_audio
    main_transition
    # Main loop
    loop do
      main_loop
      break if main_scenechange?
    end
    main_pre_terminate
    # Prepare for transition
    Graphics.freeze
    main_dispose
    main_terminate
  end
  #--------------------------------------------------------------------------
  # * Main Processing: Variable
  #--------------------------------------------------------------------------
  def main_variable ;end
  #--------------------------------------------------------------------------
  # * Main Processing: Spriteset
  #--------------------------------------------------------------------------
  def main_spriteset ;end
  #--------------------------------------------------------------------------
  # * Main Processing: Windows
  #--------------------------------------------------------------------------
  def main_window ;end
  #--------------------------------------------------------------------------
  # * Main Processing: Audio
  #--------------------------------------------------------------------------
  def main_audio ;end
  #--------------------------------------------------------------------------
  # * Main Processing: Transition
  #--------------------------------------------------------------------------
  def main_transition
    # Execute transition
    Graphics.transition
  end
  #--------------------------------------------------------------------------
  # * Main Loop
  #--------------------------------------------------------------------------
   def main_loop 
     # Update game screen
     Graphics.update
     # Update input information
     Input.update
     # Frame update
     update
   end
  #--------------------------------------------------------------------------
  # * Scene Change
  #--------------------------------------------------------------------------
  def main_scenechange?
    # Abort loop if screen is changed
    return $scene != self
  end
  #--------------------------------------------------------------------------
  # * Main Processing: Pre-termination
  #--------------------------------------------------------------------------
  def main_pre_terminate ;end
  #--------------------------------------------------------------------------
  # * Main Processing: Object Disposing
  #--------------------------------------------------------------------------
  def main_dispose ;end
  #--------------------------------------------------------------------------
  # * Main Processing: End
  #--------------------------------------------------------------------------
  def main_terminate ;end
end

 

 

**사용법:
  Scene_Base를 사용하는 스크립트는 class Scene_(이름) <Scene_Base로 현재 작성하는 클래스가 Scene_Base를 상속받음을 명시해야 합니다(상속이 맞나 모르겠네.... 배운 지 오래되어서).
그리고 (상속받은)상위 클래스에 정의된 것을 그대로 쓰고 싶다면 super를 써 준다든가.... 그런 식으로 하면 됩니다. 


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
254 기타 횡스크롤 스크립트 한국말 번역. 15 file 백호 2009.02.21 3311
253 기타 회복으로 데미지를 받는 좀비 스크립트 7 백호 2009.02.22 2004
252 기타 홈페이지 띄우기 (VX 상관없음.) 6 KNAVE 2009.08.25 2137
251 기타 현재시간표시 33 file 코아 코스튬 2010.10.09 2528
250 기타 현재 맵BGM을 그대로 전투 BGM으로 연결 from phylomortis.com 백호 2009.02.22 1180
249 기타 한글 입력 스크립트 입니다. (vx -> xp) 23 file 헤르코스 2009.04.18 3397
248 기타 한계 돌파스크립트 8 G MAX 2009.09.03 2205
247 기타 하나더올립니다....하암........이건...렙제라네요 7 벨☆ 2010.01.23 1754
246 기타 필요 경험치 직접 정하기 9 백호 2009.02.21 1408
245 기타 필드에서 체력을 출력합니다. 4 백호 2009.02.22 1737
244 기타 필드에서 마력을 출력합니다. 백호 2009.02.22 983
243 기타 필드에서 경험치%를 표시합니다. 4 file 백호 2009.02.22 1448
242 기타 플레이어 발소리 스크립트 20 백호 2009.02.22 3107
241 기타 프리 윈도우 스크립트 (상입오두막 출처) 6 백호 2009.02.21 1449
240 기타 프레임 적용 스크립트 1 file 백호 2009.02.21 1007
239 기타 풀스크린 스크립트 2 백호 2009.02.22 1407
238 기타 폰트 자동 설치 스크립트 12 file 백호 2009.02.22 2865
237 기타 포커(Blackjack) 게임을 도입하는 스크립트 5 file 백호 2009.02.21 1674
236 기타 파노라마 스크롤 스크립트 개량판 by Guillaume777 1 백호 2009.02.22 896
235 기타 특수효과 ElseEX 스크립트 file 백호 2009.02.21 995
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 Next
/ 13