VX 스크립트

Source Thread: http://www.hbgames.org/forums/viewtopic.php?f=11&t=76084

  전체화면 스크립트입니다.  어떻게 되는지는 직접 스크립트를 넣고 실행시켜 보세요.  전체화면 키는 F5.


# Fullscreen++ v1.0 by Zeus81
# Description :
#   New fullscreen mode that is more smart and make a better use of the screen surface (no black frame).
#   Alt+Enter still use the old fullscreen mode, to use the new one press F5.
#   To make the game start automatically in fullscreen mode, see line 12.
# Functions :
#   Graphics.fullscreen?       : return the fullscreen state.
#   Graphics.fullscreen_mode   : go to fullscreen mode.
#   Graphics.windowed_mode     : go to windowed mode.
#   Graphics.toggle_fullscreen : toggle from one to the other.
class << Graphics
  fullscreen_start = false
  
  FindWindow       = Win32API.new('user32', 'FindWindow'      , 'pp'          , 'l')
  CreateWindowEx   = Win32API.new('user32', 'CreateWindowEx'  , 'lpplllllllll', 'l')
  UpdateWindow     = Win32API.new('user32', 'UpdateWindow'    , 'l'           , 'l')
  ShowWindow       = Win32API.new('user32', 'ShowWindow'      , 'll'          , 'l')
  SetWindowLong    = Win32API.new('user32', 'SetWindowLong'   , 'lll'         , 'l')
  SetWindowPos     = Win32API.new('user32', 'SetWindowPos'    , 'lllllll'     , 'l')
  GetSystemMetrics = Win32API.new('user32', 'GetSystemMetrics', 'l'           , 'l')
  GetDC            = Win32API.new('user32', 'GetDC'           , 'l'           , 'l')
  FillRect         = Win32API.new('user32', 'FillRect'        , 'lpl'         , 'l')
  CreateSolidBrush = Win32API.new('gdi32' , 'CreateSolidBrush', 'l'           , 'l')
  if first_start = !method_defined?(:zeus81_fullscreen_update)
    @@MainWindow = FindWindow.call('RGSS Player', 0)
    @@BackWindow = CreateWindowEx.call(0x08000008, 'Static', '', 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0)
    @@FillRectArgs = [GetDC.call(@@BackWindow), [0,0,0xFFFF,0xFFFF].pack('L4'), CreateSolidBrush.call(0)]
    @@fullscreen = false
    alias zeus81_fullscreen_resize_screen resize_screen
    alias zeus81_fullscreen_update        update
  end
  def update
    zeus81_fullscreen_update
    toggle_fullscreen if Input.trigger?(Input::F5)
  end
  def resize_screen(width, height)
    zeus81_fullscreen_resize_screen(width, height)
    fullscreen_mode if fullscreen?
  end
  def fullscreen?() @@fullscreen end
  def toggle_fullscreen() fullscreen? ? windowed_mode : fullscreen_mode end
  def fullscreen_mode
    client_w, client_h = GetSystemMetrics.call(0), GetSystemMetrics.call(1)
    w, h = client_w, client_w * height / width
    h, w = client_h, client_h * width / height if h > client_h
    ShowWindow.call(@@BackWindow, 3)
    UpdateWindow.call(@@BackWindow)
    FillRect.call(*@@FillRectArgs)
    SetWindowPos.call(@@MainWindow, -1, (client_w-w)/2, (client_h-h)/2, w, h, 0)
    SetWindowLong.call(@@MainWindow, -16, 0x14000000)
    @@fullscreen = true
  end
  def windowed_mode
    client_w, client_h = GetSystemMetrics.call(0), GetSystemMetrics.call(1)
    w = width + GetSystemMetrics.call(5)*2 + 4
    h = height + GetSystemMetrics.call(6)*2 + 4 + GetSystemMetrics.call(4)
    ShowWindow.call(@@BackWindow, 0)
    SetWindowPos.call(@@MainWindow, -2, (client_w-w)/2, (client_h-h)/2, w, h, 0)
    SetWindowLong.call(@@MainWindow, -16, 0x14CA0000)
    @@fullscreen = false
  end
  Graphics.fullscreen_mode if first_start and fullscreen_start
end


**이 스크립트는 동영상 재생 스크립트나 스크린샷 스크립트 등과 호환되지 않을 수 있습니다.

Comment '2'
  • ?
    MinaAubert 2012.09.19 14:17
    감사히 쓰겠습니다 ^^
  • ?
    비형 2015.07.15 11:02
    혹시 전체화면 시 좌우에 검정색 여백 없애는 방법 좀 알 수 있을까요?

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5408
110 기타 좀 뭐랄까... 어이없는 "비행선 더 높게 날아오르게 하기!"스크립트.... 8 루시페르 2009.06.06 2426
109 기타 전투후 이어지는 베경음 9 비극ㆍ 2010.04.19 2190
108 기타 적 선택시 스킬창 비표시 + 타겟 플래쉬 7 훈덕 2009.06.14 2094
107 기타 장애물을 피하고 다가오게 하는 스크립트 5 file 박력남 2014.02.25 1877
106 기타 작은 게이지바 표시 스크립트 44 file 허걱 2009.02.05 5979
105 기타 이벤트 제작용 소품 모음 스크립트 12 시트르산 2010.09.10 2209
104 기타 이벤트 위치 저장 스크립트 10 Tofuman 2008.12.11 2096
103 기타 이벤트 상세효과 9 file 사람이라면? 2010.08.15 2801
102 기타 이벤트 뿌리기 + 범위지정 8 file 허걱 2009.07.13 2698
101 기타 요리 시스템을 도입하는 스크립트입니다. 9 file 스페나로츠 2011.08.18 3145
100 기타 여러스크립트(목적은 포인트) 12 file 인생은 힘들다. 2011.08.26 3088
99 기타 액터선택지제작 간편화 스크립트 7 Evangelista 2009.02.26 4082
98 기타 앞에있는 이벤트 아이디 찾기 6 허걱 2009.08.21 2091
97 기타 아키루냥님 요청 스크립트(자작) 4 file Last H 2009.02.22 2754
96 기타 아이콘 캐릭터 17 file 허걱 2010.02.28 4225
95 기타 아이디를 띄우기 20 12345678 2011.11.07 4627
94 기타 심플 마우스 시스템 1.5 애드온 11 file RMdude 2009.02.11 4325
93 기타 시야범위 스크립트 18 file 좀비사냥꾼 2009.03.19 4047
92 기타 시야범위 스크립트 22 file 카르와푸딩의아틀리에 2009.06.30 4025
91 기타 스크립트로 커먼 이벤트 실행 [수정] 3 허걱 2009.08.17 2311
Board Pagination Prev 1 2 3 4 5 6 7 Next
/ 7