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
597 맵/타일 타일셋 변경 10 file 만들어보자꾸나 2008.06.08 4371
596 맵/타일 타일 태그 및 4방향 설정 7 file 만들어보자꾸나 2008.06.08 2668
595 맵/타일 타일 바꾸기 13 file 허걱 2009.09.01 3687
594 타이틀/게임오버 타이틀화면 커스터마이즈 29 file 可わいい 2009.03.16 6141
593 타이틀/게임오버 타이틀전 공지사항 19 file AYARSBMA 2010.01.23 3583
592 타이틀/게임오버 타이틀에서 홈페이지 연결 17 비극ㆍ 2010.04.19 2271
591 타이틀/게임오버 타이틀에 스토리맵을 달자 26 file RPGbooster 2008.10.08 4829
590 타이틀/게임오버 타이틀에 날씨 효과 주는 스크립트 (Melmarvin's Rainy Title Screen) 6 MinaAubert 2012.09.13 2323
589 타이틀/게임오버 타이틀 화면에 매뉴창 이동방법 5 석산 2009.01.06 2824
588 타이틀/게임오버 타이틀 업그레이드 byMOG 16 *ps인간 2009.01.26 5658
587 타이틀/게임오버 타이틀 메뉴 스크립트 50 아방스 2009.01.20 7503
586 타이틀/게임오버 타이틀 로고 26 file RPGbooster 2008.10.08 4950
585 타이틀/게임오버 타이틀 공지 37 file 허걱 2009.08.10 4748
584 기타 타격관계도 등의 한계돌파 11 시트르산 2010.09.10 2365
583 기타 클리어 횟수 기록하기 8 file 허걱 2009.08.22 2729
582 퀘스트 퀘스트 스크립트 39 file RPGbooster 2008.10.11 6139
581 퀘스트 퀘스트 마크 표시용 스크립트 10 file 허걱 2012.05.22 3704
580 타이틀/게임오버 코아 코스튬씨의 랜덤 타이틀 스크립트를 VX용으로 변환 2 Alkaid 2012.09.14 1704
579 케릭터 텍스트박스 18 file RPGbooster 2008.10.08 4709
578 컴퓨스트 플레이어 워크(?) 2 Man... 2008.10.27 1304
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 32 Next
/ 32