Save-Point
Mac's Border/Outline Script - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+---- Forum: RPGMaker XP (RGSS) Engine (https://www.save-point.org/forum-116.html)
+---- Thread: Mac's Border/Outline Script (/thread-2426.html)



Mac's Border/Outline Script - Mac - 03-07-2008

Macs Border/Outline Script


Introduction
What this script does is rather simple, its creates a nice little outline around your original text, to get this to work on your chosen text replace you
Code:
draw_text
with
Code:
draw_text_border
and then you should have yourself a nice little outline.

Script
Add me above Main Winking
Code:
#==============================================================================
#  Border Text Script by Mac
#------------------------------------------------------------------------------
#  This script allows the addon of outlines to your text.
#==============================================================================
class Bitmap
  #--------------------------------------------------------------------------
  # * Draw Text Border
  #     x        : draw spot x-coordinate
  #     y        : draw spot y-coordinate
  #     width    : draw width
  #     height   : draw height
  #     text     : draw text
  #     allign   : draw allignment
  #--------------------------------------------------------------------------
  def draw_text_border(x,y,width,height,text,align=0)
    store_color = Color.new(self.font.color.red,self.font.color.green,self.font.color.blue,self.font.color.alpha)
   #--------------------------------------------------------------------------  
   #  The line: self.font.color = Color.new(0,0,0,self.font.color.alpha)
   #  defines the border colour e.g 0,0,0 being black, 255,255,255 being
   #  white etc
   #--------------------------------------------------------------------------
    self.font.color = Color.new(0,0,0,self.font.color.alpha)
    draw_text(x-1,y-1,width,height,text,align)
    draw_text(x-1,y+1,width,height,text,align)
    draw_text(x+1,y-1,width,height,text,align)
    draw_text(x+1,y+1,width,height,text,align)
    self.font.color = store_color
    draw_text(x,y,width,height,text,align)
  end
end
Authors Notes
I know this isn't exactly a great script its just a little addon i was making.