Khai's Custom Window Helper / Simple Font
Version: 1.2
Author: Khai
Release Date: 7/21/2008
Updated: 7/23/2008
Screenshot:
Place above main and customize/use.
NOTE: For the gradient bar, the colors are drawn from your Window color sheet. The little squares indexing from 0-31
EXAMPLE!
http://img299.imageshack.us/img299/3532/colorsxa1.jpg[/img]
This is my first script so be kind.
Comments/Suggestions/feedback are greatly welcomed!
Version: 1.2
Author: Khai
Release Date: 7/21/2008
Updated: 7/23/2008
# â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â–Â
# Khai's Custom Window Helper / Simple Font v1.2
# â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â–Â
# This is a simple custom edit for the Window Helper. It replaces the original
# with additional customization so you can resize, change the color/style of the
# backdrop, and disable/enable Window_Help. It's made easier for users with
# custom screen resolution to fix their helper position as well.
# Included features
# - Gradiant bar
# - Background bar
# - Text Color
# - Read more in the configuration for info
# Release 7/21/2008
# Update 7/23/2008
#
# Version History
# 1.0 - Initial release
# 1.1 - Minor Fixes, no noticible update 7/22/08
# 1.2 - Added gradiant bars, background bar + minor fixes 7/23/08
# and Object name draw idea by pim321.
#
# Should be compatable with most if not all scripts.
# Setup -> Place above Main, read more to config.
# Feel free to use, credit to me(Khai).
# â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â–Â
Code:
# â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â–Â
# Khai's Custom Window Helper / Simple Font v1.2
# â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â–Â
# This is a simple custom edit for the Window Helper. It replaces the original
# with additional customization so you can resize, change the color/style of the
# backdrop, and disable/enable Window_Help. It's made easier for users with
# custom screen resolution to fix their helper position as well.
# Included features
# - Gradient bar
# - Background bar
# - Text Color
# - Read more in the configuration for info
# Released at [
# http://www.rpgrevolution.com/forums/?showtopic=17721
# http://www.rmxp.org/forums/index.php?topic=52176.0
# ]
# Release 7/21/2008
# Update 7/23/2008
#
# Version History
# 1.0 - Initial release
# 1.1 - Minor Fixes, no noticible update 7/22/08
# 1.2 - Added gradient bars, background bar + minor fixes 7/23/08
# and Object name draw idea by pim321.
#
# Should be compatable with most if not all scripts.
# Setup -> Place above Main, read more to config.
# Feel free to use, credit to me(Khai).
#
# â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â–Â
module KCWH
# â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â–Â
# Config BEGIN
# Extra info displays the object name before the description. Examples below.
# Extra Info
K_Equip = true # Display name before info if true e.g.
K_Skill = true # "Potion - It heals" and without,
K_Item = true # "It heals" If false.
# â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â–Â
# Helper Frame Setting/Text Alignment
K_WH_ON = true # Helper on/off (true/false) If false, no setup needed.
K_Opacity = 0 # Help window frame opacity (0-255)
K_WH_X = 544 # Help window frame width X (Default: 544)
K_WH_Y = 32 # Help window frame height Y (Default: 32)
K_WH_Z = 0 # Determines if the helper is on top of other windows.
#Increase to change layer setting. Higher #'s = Higher priority
K_POSX = 0 # Help window x position on screen
K_POSY = 0 # Help window y position on screen
K_ALIGN = 1 # Help text alignment [0 = left, 1 = center, 2 = right]
# â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â–Â
# Helper Backdrop SETTING/LOCATION/STYLE
# This configures your Graphical Bar, not frame. If K_HW = false
# you do not need to configure this section.
K_WH = true # Helper Backdrop on/off (true/false) ENABLE/DISABLE ALL
# â– â– â– â– â– â– â– â–¼
# Important if Helper backdrop is turned on, you need to define this setting
# 0 = Normal color background bar 1 = Custom Image Background bar 2 = Gradient
K_WH_BG = 2 # 0 = default, 1 = image 2 = gradient
# â– â– â– â– â– â– â– â–¼
K_WH_BX = 0 # Background Bar X-Displacement Default 0
K_WH_BY = 0 # Background Bar Y-Displacement Default 0 (12 For style)
# â–¼ CONFIGURE for setting = 0 â–¼ â– â– â–Â
# This configures the helper background color if you just want a normal color style
# (RED,GREEN,BLUE,OPACITY) (0-255) (0,0,0,255) = black with 100% opacity
K_WHC = Color.new(255, 0, 0, 150) # Helper backdrop color
#
# â–¼ CONFIGURE for setting = 1 â–¼ â– â– â–Â
BG = "" # This is the name of your background image file, generally
# height = 25 when creating it. The width depends on your screen
# resolution
# â–¼ CONFIGURE for setting = 2 â–¼ â– â– â–Â
# Start color # Defined by your Window frame color from 0-31
K_GBC1 = 3 # Total of 32 color squares indexing start from 0.
#
K_GBC2 = 50 # *Note, if color is not defined it will be transparent E.G 50
# End color #
BG_W = 544 # Width of your gradient bar, this should match with your
# Frame's width defined above (free customization for style)
BG_H = 32 # Height of your gradient bar, this should match with your
# Frame's height defined above (free customization for style)
# else leave it alone.
# â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â–Â
# This handles the Helper's Font Color [If turned on]
K_BGC = true # TEXT Color Config below if = true, else leave alone
# Color Setting for help Text if the above K_BGC = true
K_R = 0 # Red (0-255) 255 being pure red 0 = no red
K_B = 255 # Blue (0-255) 255 being pure blue 0 = no blue
K_G = 0 # Green (0-255) 255 being pure green 0 = no green
# Font Setup
# Font Setup
# â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â–Â
Enable_Text = true # Use Simple Font? Turn this to false if you have/use
# other Font scripts
Font_Name = 'Arial' # Font Name [some font examples : Arial ] Constantia
Font_Size = 16 # Font Size
Font_Bold = true # Font Bold
Font_Italic = false # Font Italic
Font_Shadow = true # Font Shadow
# â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â–Â
# Config END
end
class Window_Help < Window_Base
def initialize
super(KCWH::K_POSX, KCWH::K_POSY, KCWH::K_WH_X, WLH + KCWH::K_WH_Y)
self.opacity = KCWH::K_Opacity
self.visible = KCWH::K_WH_ON
end
def set_text(text, align = KCWH::K_ALIGN)
if text != @text or align != @align
self.contents.clear
self.z = KCWH::K_WH_Z
def b_color1
return text_color(KCWH::K_GBC1)
end
def b_color2
return text_color(KCWH::K_GBC2)
end
if KCWH::K_BGC == true
self.contents.font.color.set(KCWH::K_R,KCWH::K_B,KCWH::K_G)
else
self.contents.font.color = normal_color
end
if KCWH::K_WH == true
if KCWH::K_WH_BG == 0
self.contents.fill_rect(KCWH::K_WH_BX, y=KCWH::K_WH_BY, contents.width, WLH - y, KCWH::K_WHC )
elsif KCWH::K_WH_BG == 1
bg_bitmap = Cache.system(KCWH::BG)
self.contents.blt(KCWH::K_WH_BX, KCWH::K_WH_BY, bg_bitmap, bg_bitmap.rect)
elsif KCWH::K_WH_BG == 2
gc1 = b_color1
gc2 = b_color2
self.contents.gradient_fill_rect(KCWH::K_WH_BX, KCWH::K_WH_BY, KCWH::BG_W, KCWH::BG_H, gc1, gc2)
end
end
@text = text
@align = align
self.contents.draw_text(20, 0, self.width - 72, WLH, text, align)
end
end
end
if KCWH::Enable_Text == true
class Font
@@default_name = [KCWH::Font_Name]
@@default_size = KCWH::Font_Size
@@default_bold = KCWH::Font_Bold
@@default_italic = KCWH::Font_Italic
@@default_shadow = KCWH::Font_Shadow
end
if KCWH::K_Equip == true
class Window_Equip < Window_Selectable
def update_help
@help_window.set_text(item == nil ? "" : item.name+" - "+item.description)
end
end
end
if KCWH::K_Skill == true
class Window_Skill < Window_Selectable
def update_help
@help_window.set_text(skill == nil ? "" : skill.name+" - "+skill.description)
end
end
end
if KCWH::K_Item == true
class Window_Item < Window_Selectable
def update_help
@help_window.set_text(item == nil ? "" : item.name+" - "+item.description)
end
end
end
end
Screenshot:
http://img204.imageshack.us/img204/2041/kwhdemoyo8.jpg[/img]
http://img246.imageshack.us/img246/7981/example2ft8.jpg[/img]
http://img384.imageshack.us/img384/8815/53397289ku1.jpg[/img]
http://img246.imageshack.us/img246/7981/example2ft8.jpg[/img]
http://img384.imageshack.us/img384/8815/53397289ku1.jpg[/img]
Place above main and customize/use.
NOTE: For the gradient bar, the colors are drawn from your Window color sheet. The little squares indexing from 0-31
EXAMPLE!
http://img299.imageshack.us/img299/3532/colorsxa1.jpg[/img]
This is my first script so be kind.
Comments/Suggestions/feedback are greatly welcomed!