Code:
module Resolution
#==============================================================================
# Resolution Script
#------------------------------------------------------------------------------
# Script by Selwyn
# Edited by Cornix
# Requires Display.dll
#==============================================================================
FRAME_WIDTH = 6
FRAME_HEIGHT = 24
title = "\0" * 256
Win32API.new('kernel32', 'GetPrivateProfileString','PPPPLP', 'L').call("Game", "Title", "", title, 256, ".\\Game.ini")
title.delete!("\0")
$get_system_metrics = Win32API.new('user32', 'GetSystemMetrics', 'I', 'I')
$window = Win32API.new('user32', 'FindWindow', 'PP', 'I').call("RGSS Player", title)
@set_resolution = Win32API.new('Display.dll', 'SetResolution', 'III', 'I')
@set_window_long = Win32API.new('user32', 'SetWindowLong', 'LIL', 'L')
@set_window_pos = Win32API.new('user32', 'SetWindowPos', 'LLIIIII', 'I')
module_function
def fullscreen(width,height)
@set_window_long.call($window, -16, 0x14000000)
@set_window_pos.call($window, -1, 0, 0, width, height, 64)
@set_resolution.call(width, height, 4)
end
def set_size(width,height)
width += FRAME_WIDTH
height += FRAME_HEIGHT
monitor_width = $get_system_metrics.call(0)
monitor_height = $get_system_metrics.call(1)
x = (monitor_width - width) / 2
y = (monitor_height - height) / 2
@set_window_long.call($window, -16, 0x14CA0000)
@set_window_pos.call($window, 0, x, y, width, height, 0)
@set_resolution.call(monitor_width, monitor_height, 0)
end
end