TheBen's Shaded Text Script
Version 1.0
Description
A rather subtle edit that adds a drop shadow to any text in the game. Unlike VX, however, you can control the color, offset, and relative opacity of the shadow itself.
Screenshot

The Script CODE
#-------------------------------------------------------------------------------
#Shadowed Text Edit
# TheBen | V1.0
#-------------------------------------------------------------------------------
# ABSTRACT
#Edits the draw_text command to add VX-esque shadows to your game's text.
#Be forewarned that this does require the system to draw twice as much
#text as usual (drawing text is said to be a CPU-intensive method).
#-------------------------------------------------------------------------------
# COMPATABILITY
# Will seriously mess up any scripts of this nature (or of the outlined-text
# nature). Otherwise, it's pretty much good to go.
#-------------------------------------------------------------------------------
# CUSTOMIZATION
module SHADOWTEXT
# r, g, b
COLOR = Color.new(0, 0, 0) #The color used for shadows. (0-255 each)
OPAC_PERCENT = 50 #Percentage of opacity based on current font opac. (0-100)
#Shadow Offset
XOFFSET = 2 #X offset of the shadow, in pixels. (Right -> positive)
YOFFSET = 2 #Y offset of the shadow, in pixels. (Down -> positive)
end
#-------------------------------------------------------------------------------
#Bitmap Edit - adds shaded text
class Bitmap
#Aliased method - shaded text for pretty much everything
alias ben_shaded_draw_text draw_text unless $@
def draw_text(*args)
return if self.font.color.alpha == 0
#Color Memorization
memo_color = self.font.color.dup #Memorized for frontal text
self.font.color = SHADOWTEXT::COLOR
self.font.color.alpha = memo_color.alpha*(SHADOWTEXT::OPAC_PERCENT.to_f/100)
#Drawing Shadow
if args[0].class == Rect #Rect Arguments
pos = args[0].dup
pos.x += SHADOWTEXT::XOFFSET
pos.y += SHADOWTEXT::YOFFSET
ben_shaded_draw_text(pos, *args[1...args.length])
else #X-Y-Width-Height arguments
pos = args[0..1]
pos[0] += SHADOWTEXT::XOFFSET
pos[1] += SHADOWTEXT::YOFFSET
ben_shaded_draw_text(pos[0], pos[1], *args[2...args.length])
end
#Drawing regular text
self.font.color = memo_color
ben_shaded_draw_text(*args)
end
#New method - drawing text without shadows
def draw_text_reg(*args)
ben_shaded_draw_text(*args)
end
end
Compatibility
This will probably work with all scripts, but just to be safe, you might want to put this below any other text-altering scripts you have (e.g. text outline).
Credit and Redistribution
Credit is not necessary for this script, but it is highly appreciated. If you wish to distribute this script outside of RPGRevolution.com, PM me and I'll try and work it out with you.
Please rate, comment and provide criticism as you wish.