#==============================================================================
# ★RGSS2
# *STR11b_XP Battle Style #Battle Message v1.2 08/01/26
# Created by star: [url]http://otsu.cool.ne.jp/strcatyou/[/url]
# Translated by Mr. Bubble
#
# ・Battle message appears with transparent background at
# the upper left of the screen.
#
#------------------------------------------------------------------------------
#==============================================================================
# ■ Window_BattleMessage
#==============================================================================
class Window_BattleMessage < Window_Message
# Gradient Background [Left, Right]
TEXT_B_COLOR = [Color.new(0,0,0,160), Color.new(0,0,0,0)]
INFO = "信息" # String that shows at the upper left of message window
BTWIDTH = 320 # Message Width
MOVE = false # Smooth resize of lines
SPEED = 1 # Resize Speed
W_OPACITY = 96 # Transparency 1~255
#
N_WINDOW = false # Window is not converted transparent
SwitchesID = 10
#--------------------------------------------------------------------------
# ★ エイリアス
#--------------------------------------------------------------------------
alias initialize_str11b initialize
def initialize
initialize_str11b
self.x = 0
self.y = 0
self.back_opacity = 0
self.opacity = 0
@b_sprite = Sprite.new(self.viewport)
bitmap = Bitmap.new(BTWIDTH, 96 + 16)
bitmap.gradient_fill_rect(0, 16, BTWIDTH, 96, TEXT_B_COLOR[0], TEXT_B_COLOR[1])
bitmap.font.shadow = false
bitmap.font.size = 16
bitmap.draw_text(2, 2, BTWIDTH, 16, INFO)
@b_sprite.bitmap = bitmap
@b_sprite.x = self.x
@b_sprite.y = self.y
@b_sprite.src_rect.height = 16
@b_sprite.opacity = 0
@str11f = false
end
alias dispose_str11b dispose
def dispose
dispose_str11b
@b_sprite.bitmap.dispose
@b_sprite.dispose
end
alias update_str11b update
def update
update_str11b
@b_sprite.visible = $game_switches[SwitchesID]
if $game_switches[SwitchesID]
if self.visible and (@lines.size > 0 and not @str11f) or
(@text != nil or self.pause or [url=home.php?mod=space&uid=370741]@Index[/url] > -1)
@b_sprite.opacity += W_OPACITY
h = @b_sprite.src_rect.height
if @text != nil
@l = 4
else
unless self.pause or @index > -1
@l = @lines.size
else
@l = 4
end
end
if MOVE
if SPEED == 1
@b_sprite.src_rect.height = 16 + (@l * 24)
else
s = (SPEED - 1)
@b_sprite.src_rect.height = (h + ((16 + (@l * 24)) * s)) / SPEED
end
else
@b_sprite.src_rect.height = 96 + 16
end
else
@b_sprite.opacity -= W_OPACITY
end
else
if self.visible
self.back_opacity += W_OPACITY
self.opacity += W_OPACITY
self.back_opacity = 200 if self.back_opacity > 200
else
self.back_opacity -= W_OPACITY
self.opacity -= W_OPACITY
end
end
end
end