class Scene_Map < Scene_Base FindWindowEx = Win32API.new('user32', 'FindWindowEx', 'llpp', 'i') HWnd = FindWindowEx.call(0, 0, 'RGSS Player', 0) SetWindowPos = Win32API.new('user32', 'SetWindowPos', 'liiiiip', 'i') GetWindowRect = Win32API.new('user32','GetWindowRect',['l','p'],'i') #-------------------------------------------------------------------------- # ● 更新画面 #-------------------------------------------------------------------------- alias _update update def update _update if $game_switches[1] if @_shake_timer.nil? @_shake_timer = 0 @_window_rect = "\0" * 16 GetWindowRect.call(HWnd, @_window_rect) end update_shake else if @_window_rect x, y, wr, wb = @_window_rect.unpack('L4') w, h = wr - x, wb - y SetWindowPos.call(HWnd, 0, x, y, w, h, 0) @_window_rect = nil end @_shake_timer = nil end end def update_shake x, y, wr, wb = @_window_rect.unpack('L4') w, h = wr - x, wb - y case @_shake_timer = (@_shake_timer + 1) % 34 when 0 then SetWindowPos.call(HWnd, 0, x - 50, y - 50, w, h, 0) when 2 then SetWindowPos.call(HWnd, 0, x, y, w, h, 0) when 4 then SetWindowPos.call(HWnd, 0, x , y - 50, w, h, 0) when 6 then SetWindowPos.call(HWnd, 0, x, y, w, h, 0) when 8 then SetWindowPos.call(HWnd, 0, x + 50, y - 50 , w, h, 0) when 10 then SetWindowPos.call(HWnd, 0, x, y, w, h, 0) when 12 then SetWindowPos.call(HWnd, 0, x + 50, y, w, h, 0) when 14 then SetWindowPos.call(HWnd, 0, x, y, w, h, 0) when 16 then SetWindowPos.call(HWnd, 0, x + 50, y + 50, w, h, 0) when 20 then SetWindowPos.call(HWnd, 0, x, y, w, h, 0) when 22 then SetWindowPos.call(HWnd, 0, x, y + 50, w, h, 0) when 24 then SetWindowPos.call(HWnd, 0, x, y, w, h, 0) when 26 then SetWindowPos.call(HWnd, 0, x - 50, y + 50, w, h, 0) when 28 then SetWindowPos.call(HWnd, 0, x, y, w, h, 0) when 30 then SetWindowPos.call(HWnd, 0, x - 50, y, w, h, 0) when 32 then SetWindowPos.call(HWnd, 0, x, y, w, h, 0) end end end
class Scene_Map < Scene_Base
FindWindowEx = Win32API.new('user32', 'FindWindowEx', 'llpp', 'i')
HWnd = FindWindowEx.call(0, 0, 'RGSS Player', 0)
SetWindowPos = Win32API.new('user32', 'SetWindowPos', 'liiiiip', 'i')
GetWindowRect = Win32API.new('user32','GetWindowRect',['l','p'],'i')
#--------------------------------------------------------------------------
# ● 更新画面
#--------------------------------------------------------------------------
alias _update update
def update
_update
if $game_switches[1]
if @_shake_timer.nil?
@_shake_timer = 0
@_window_rect = "\0" * 16
GetWindowRect.call(HWnd, @_window_rect)
end
update_shake
else
if @_window_rect
x, y, wr, wb = @_window_rect.unpack('L4')
w, h = wr - x, wb - y
SetWindowPos.call(HWnd, 0, x, y, w, h, 0)
@_window_rect = nil
end
@_shake_timer = nil
end
end
def update_shake
x, y, wr, wb = @_window_rect.unpack('L4')
w, h = wr - x, wb - y
case @_shake_timer = (@_shake_timer + 1) % 34
when 0 then SetWindowPos.call(HWnd, 0, x - 50, y - 50, w, h, 0)
when 2 then SetWindowPos.call(HWnd, 0, x, y, w, h, 0)
when 4 then SetWindowPos.call(HWnd, 0, x , y - 50, w, h, 0)
when 6 then SetWindowPos.call(HWnd, 0, x, y, w, h, 0)
when 8 then SetWindowPos.call(HWnd, 0, x + 50, y - 50 , w, h, 0)
when 10 then SetWindowPos.call(HWnd, 0, x, y, w, h, 0)
when 12 then SetWindowPos.call(HWnd, 0, x + 50, y, w, h, 0)
when 14 then SetWindowPos.call(HWnd, 0, x, y, w, h, 0)
when 16 then SetWindowPos.call(HWnd, 0, x + 50, y + 50, w, h, 0)
when 20 then SetWindowPos.call(HWnd, 0, x, y, w, h, 0)
when 22 then SetWindowPos.call(HWnd, 0, x, y + 50, w, h, 0)
when 24 then SetWindowPos.call(HWnd, 0, x, y, w, h, 0)
when 26 then SetWindowPos.call(HWnd, 0, x - 50, y + 50, w, h, 0)
when 28 then SetWindowPos.call(HWnd, 0, x, y, w, h, 0)
when 30 then SetWindowPos.call(HWnd, 0, x - 50, y, w, h, 0)
when 32 then SetWindowPos.call(HWnd, 0, x, y, w, h, 0)
end
end
end
|