$VIPArcherScript ||= {};$VIPArcherScript[:black_message] = 20150225
module VIPArcher end
module VIPArcher::Black_Message_Layer
Z = 1
SW = 1
Edge = 24
Width = 544
Height = 40
Black_Color = Color.new(0,0,0)
Oy_Speed = 4
Opacity_Speed = 16
end
class Sprite_Message_Layer < Sprite
include VIPArcher::Black_Message_Layer
H = Height + Edge
def initialize(pos = false,viewport = nil)
super(viewport)
@pos = pos
self.opacity, self.z = 0 , Z
self.oy = @pos ? H : -H
set_bitmap
end
def set_bitmap
rect1 = Rect.new(0,@pos ? 0 : Edge,Width,Height)
rect2 = Rect.new(0,@pos ? Height : 0,Width,Edge)
self.bitmap = Bitmap.new(544,H)
self.y = Graphics.height - bitmap.height unless @pos
color1,color2 = Black_Color,Color.new
self.bitmap.fill_rect(rect1, color1)
self.bitmap.gradient_fill_rect(rect2,
@pos ? color1 : color2, @pos ? color2 : color1,true)
end
def update
update_fadeout unless $game_switches[SW]
update_fadein if $game_switches[SW]
end
def update_fadein
if oy.abs > 0
self.oy += @pos ? -Oy_Speed : Oy_Speed
self.opacity += Opacity_Speed
end
end
def update_fadeout
if oy.abs < H
self.oy += @pos ? Oy_Speed : -Oy_Speed
self.opacity -= Opacity_Speed
end
end
def dispose
super
self.bitmap.dispose
end
end
class Spriteset_Map
alias message_layer_sprite_create_timer create_timer
def create_timer
message_layer_sprite_create_timer
@down_message_layer = Sprite_Message_Layer.new(false,@viewport2)
@up_message_layer = Sprite_Message_Layer.new(true,@viewport2)
end
alias message_layer_sprite_dispose dispose
def dispose
message_layer_sprite_dispose
@up_message_layer.dispose
@down_message_layer.dispose
end
alias message_layer_sprite_update update
def update
message_layer_sprite_update
@up_message_layer.update
@down_message_layer.update
end
end