#==============================================================================#
# Txt - Backshadow Text Method for Bitmaps & Windows
#------------------------------------------------------------------------------#
# Description:
# Draws text with color and a black back shadow.
# Colors can be defined here by strings & integers.
#------------------------------------------------------------------------------#
# Directions:
# 1. Add your custom colors.
# 2. use txt(x, y, width, height, text, center, color)
# in place of draw_text(x, y, width, height, text, center, color)
# color is optional :P
#------------------------------------------------------------------------------#
# Credit:
# Zexion of Chaos-Project
#==============================================================================#
module BST
COLORS = { 1 => Color.new(255,255,255,255), # White
2 => Color.new(255,255,0,255), # Yellow
3 => Color.new(50, 50, 50, 255), # Grey
4 => Color.new(255,102,0,255), # Orange
5 => Color.new(156,156,215,255), # Light Blue
6 => Color.new(255,0,0,255), # Red
7 => Color.new(0,255,0,255)} # Green
end
class Window_Base < Window
#---------------------------------------------------------------------------
# * txt
# x : draw spot x
# y : draw spot y
# width : width of the string
# height: height of the string
# text : the text to draw
# center: 0 left align 1 center align 2 right align
# color : color of font
#---------------------------------------------------------------------------
def txt(x, y, width, height, text, center, color=0)
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x+1, y+1, width, height, text, center)
if color > 0
self.contents.font.color = BST::COLORS[color]
else
# White
self.contents.font.color = Color.new(255,255,255,255)
end
self.contents.draw_text(x, y, width, height, text, center)
end
end
class Bitmap
#---------------------------------------------------------------------------
# * txt
# x : draw spot x
# y : draw spot y
# width : width of the string
# height: height of the string
# text : the text to draw
# center: 0 left align 1 center align 2 right align
# color : color of font
#---------------------------------------------------------------------------
def txt(x, y, width, height, text, center, color=0)
font.color = Color.new(0,0,0,255)
draw_text(x+1, y+1, width, height, text, center)
if color > 0
font.color = BST::COLORS[color]
else
# White
font.color = Color.new(255,255,255,255)
end
draw_text(x, y, width, height, text, center)
end
end