=begin
#==============================================================================
窗口飞入1.1 By 霸道 QQ1711044261 (C)神话时代制作组 2016_2_2
#==============================================================================
1.1更新内容
1-【支持自动执行move_start,用起来更简便】
2-【支持余数的运算,有余数窗口也会自动归位】
#==============================================================================
窗口进入
Window_move::speed(window,index)
窗口离开
Window_move::speed_back(window,index)
说明:系统会自动执行move_start和move_end两个方法,请不要改这两个方法名,否则会无效
index
1 窗口由上到下飞入
2 窗口由下到上飞入
3 窗口由左到右飞入
4 窗口由右到左飞入
注意:这是窗口进入的index 窗口离开的index和这个相反
动画速度
窗口的默认速度为8帧
如果需要改速度 改这个全局变量即可
值越小 速度越快 值越大 速度越慢
$window_speed =
#==============================================================================
已知不足
1.0版本的不足已经全部改善,暂未发现不足
如有发现不足 请联系 QQ1711044261或66RPG ID:布罗利
已知BUG
暂未发现BUG 如发现BUG想要解决 请联系 QQ1711044261或66RPG ID:布罗利
容易出现的问题
1、====================================
问:为什么窗口离开没有效果
答:目前发现两种可能
1、有可能窗口离开的语句和窗口进入的语句写反了
窗口离开的语句必须是Window_move::speed_back(window,index)
2、有可能改动了你改动了pre_terminate这个方法,具体要根据实际脚本来解决
如有问题出现 请联系 QQ1711044261或66RPG ID:布罗利
#==============================================================================
范例:
#--------------------------------------------------------------------------
# ● 窗口进入
#--------------------------------------------------------------------------
def move_start
Window_move::speed(window,index)
end
#--------------------------------------------------------------------------
# ● 窗口离开
#--------------------------------------------------------------------------
def move_end
Window_move::speed_back(window,index)
end
#==============================================================================
=end
$window_speed = 8
$windows = []
class Scene_Base
def post_start
move_start if respond_to? :move_start
perform_transition
Input.update
Window_move::move #if respond_to? :move_start
end
def pre_terminate
move_end if respond_to? :move_end
Window_move::move_back
end
end
module Window_move
def self.speed(window,index=1)
if window == nil
return
end
window.opacity = 0
window.contents_opacity = 0
x = window.x ; y = window.y
a = 0 ; b = 0
case index
when 1
b = (window.height + y) / $window_speed
c = (window.height + y) % $window_speed
when 2
b = (Graphics.height-y) / $window_speed
c = (Graphics.height-y) % $window_speed
when 3
a = (window.width + x) / $window_speed
c = (window.width + x) % $window_speed
when 4
a = (Graphics.width-x) / $window_speed
c = (Graphics.width-x) % $window_speed
end
$windows << [window,index,a,b,c,x,y]
case index
when 1
window.y = -window.height
when 2
window.y = Graphics.height
when 3
window.x = -window.width
when 4
window.x = Graphics.width
end
end
def self.move
$window_speed.times do |i|
$windows.each do |window,n,a,b,c,x,y|
case n
when 1
window.y += b
window.opacity += 256 / $window_speed
window.contents_opacity += 256 / $window_speed
when 2
window.y -= b
window.opacity += 256 / $window_speed
window.contents_opacity += 256 / $window_speed
when 3
window.x+= a
window.opacity += 256 / $window_speed
window.contents_opacity += 256 / $window_speed
when 4
window.x -= a
window.opacity += 256 / $window_speed
window.contents_opacity += 256 / $window_speed
end
end
Graphics.update
end
$windows.each do |window,n,a,b,c,x,y|
window.x = x
window.y = y
end
$windows = []
end
################################################################################
def self.speed_back(window,index=1)
if window == nil
return
end
x = window.x
y = window.y
a = 0
b = 0
case index
when 1
b = (window.height + y) / $window_speed
when 2
b = (Graphics.height-y) / $window_speed
when 3
a = (window.width + x) / $window_speed
when 4
a = (Graphics.width-x) / $window_speed
end
$windows << [window,index,a,b]
end
def self.move_back
$window_speed.times do
$windows.each do |window,n,a,b|
case n
when 1
window.y -= b
window.opacity -= 256 / $window_speed
window.contents_opacity -= 256 / $window_speed
when 2
window.y += b
window.opacity -= 256 / $window_speed
window.contents_opacity -= 256 / $window_speed
when 3
window.x -= a
window.opacity -= 256 / $window_speed
window.contents_opacity -= 256 / $window_speed
when 4
window.x += a
window.opacity -= 256 / $window_speed
window.contents_opacity -= 256 / $window_speed
end
end
Graphics.update
end
$windows = []
end
end