Background Message System
Version: 1.0
Version: 1.0
Introduction
This script allows you to display text onscreen without interrupting the action. This is useful for cutscenes, minigames, etc. This has several advantages over the default message system.
- It does not interrupt the action. Events and characters can still move around and things can blow up while a message is onscreen.
- The player can still input, move the character, use items, etc. while the text is onscreen. This is useful for minigames where you don't want to interrupt the action.
- You can set the message to disappear exactly when you want it to in the events. This will make it much easier to make cutscenes by reducing the amount of trial and error.
- You can format the text of each individual line. You can change the face, size, color, outline, shadow, bold and italic status.
Included in attachment
Script
KGC_FrameShadowText
Spoiler
Give credit to KGC for this script!
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
#_/ â—†ç¸å–ã‚Šãƒ»å½±æ–‡å—æç”» ï¼ KGC_FrameShadowTextâ—†
#_/----------------------------------------------------------------------------
#_/ draw_text を強化ã—ã€ç¸å–りや影文å—ã®æç”»æ©Ÿèƒ½ã‚’è¿½åŠ ã—ã¾ã™ã€‚
#_/ Provides functions to draw texts which framed or dropped shadow.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
=begin
â”â”â”â”â” æè¼‰ãƒ¡ã‚½ãƒƒãƒ‰ - Methods â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”
┠─── Class - Bitmap ────────────────────────────
┃ draw_frame_text(x, y, width, height, string[, align, frame_color])
┃ draw_frame_text(rect, string[, align, frame_color])
┃ x, y : æç”»å…ˆåº§æ¨™ [Integer]
┃ Destination.
┃ width, height : æç”»ã‚µã‚¤ã‚º [Integer]
┃ Size.
┃ rect : æç”»é ˜åŸŸ [Rect]
┃ Rectangle.
┃ string : æç”»æ–‡å—列 [String]
┃ Output text.
┃ align : æ–‡å—æ•´åˆ—å½¢å¼ [Integer]
┃ Alignment.
┃ frame_color : ç¸å–り色 [Color]
┃ Frame color.
┃ 周りを frame_color ã§ç¸å–りã—ãŸæ–‡å—列をæç”»ã—ã¾ã™ã€‚
┃ Draws a character string framed in 'frame_color'.
┃
┃ draw_shadow_text(x, y, width, height, string[, align, frame_color])
┃ draw_shadow_text(rect, string[, align, frame_color])
┃ x, y : æç”»å…ˆåº§æ¨™ [Integer]
┃ Destination.
┃ width, height : æç”»ã‚µã‚¤ã‚º [Integer]
┃ Size.
┃ rect : æç”»é ˜åŸŸ [Rect]
┃ Rectangle.
┃ string : æç”»æ–‡å—列 [String]
┃ Output text.
┃ align : æ–‡å—æ•´åˆ—å½¢å¼ [Integer]
┃ Alignment.
┃ frame_color : ç¸å–り色 [Color]
┃ Frame color.
┃ å³ä¸‹ã«å½±ã‚’è½ã¨ã—ãŸæ–‡å—列をæç”»ã—ã¾ã™ã€‚
┃ Draws a character string which drops shadow to lower right.
┃
â”—â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”
=end
$imported = {} if $imported == nil
$imported["FrameShadowText"] = true
#==============================================================================
# â– Bitmap
#==============================================================================
class Bitmap
#--------------------------------------------------------------------------
# â— ç¸å–ã‚Šæ–‡å—æç”»
# x, y, width, height, string[, align, frame_color]
# rect, string[, align, frame_color]
#--------------------------------------------------------------------------
def draw_frame_text(*args)
# 引数判定
if args[0].is_a?(Rect)
if args.size >= 2 && args.size <= 4
# 引数を処ç†ç”¨ã®ãƒãƒ¼ã‚«ãƒ«å¤‰æ•°ã¸ã‚³ãƒ”ー
x, y = args[0].x, args[0].y
width, height = args[0].width, args[0].height
string = args[1]
align = args[2].equal?(nil) ? 0 : args[2]
frame_color = args[3].equal?(nil) ? Color.new(0, 0, 0) : args[3]
else
# 引数ãŒä¸æ£ãªã‚‰ã‚¨ãƒ©ãƒ¼ã‚’åã
raise(ArgumentError, "wrong number of arguments(#{args.size} of #{args.size < 2 ? 2 : 4})")
return
end
else
if args.size >= 5 && args.size <= 7
# 引数を処ç†ç”¨ã®ãƒãƒ¼ã‚«ãƒ«å¤‰æ•°ã¸ã‚³ãƒ”ー
x, y, width, height = args
string = args[4]
align = args[5].equal?(nil) ? 0 : args[5]
frame_color = args[6].equal?(nil) ? Color.new(0, 0, 0) : args[6]
else
# 引数ãŒä¸æ£ãªã‚‰ã‚¨ãƒ©ãƒ¼ã‚’åã
raise(ArgumentError, "wrong number of arguments(#{args.size} of #{args.size < 5 ? 5 : 7})")
return
end
end
# å…ƒã®è‰²ã‚’ä¿å˜
origin_color = font.color.dup
# ç¸å–り
font.color = frame_color
draw_text(x - 1, y - 1, width, height, string, align)
draw_text(x - 1, y + 1, width, height, string, align)
draw_text(x + 1, y - 1, width, height, string, align)
draw_text(x + 1, y + 1, width, height, string, align)
# å…ƒã®è‰²ã«æˆ»ã™
font.color = origin_color
draw_text(x, y, width, height, string, align)
end
#--------------------------------------------------------------------------
# â— å½±æ–‡å—æç”»
# x, y, width, height, string[, align, shadow_color]
# rect, string[, align, shadow_color]
#--------------------------------------------------------------------------
def draw_shadow_text(*args)
# 引数判定
if args[0].is_a?(Rect)
if args.size >= 2 && args.size <= 4
# 引数を処ç†ç”¨ã®ãƒãƒ¼ã‚«ãƒ«å¤‰æ•°ã¸ã‚³ãƒ”ー
x, y = args[0].x, args[0].y
width, height = args[0].width, args[0].height
string = args[1]
align = args[2].equal?(nil) ? 0 : args[2]
shadow_color = args[3].equal?(nil) ? Color.new(0, 0, 0) : args[3]
else
# 引数ãŒä¸æ£ãªã‚‰ã‚¨ãƒ©ãƒ¼ã‚’åã
raise(ArgumentError, "wrong number of arguments(#{args.size} of #{args.size < 2 ? 2 : 4})")
return
end
else
if args.size >= 5 && args.size <= 7
# 引数を処ç†ç”¨ã®ãƒãƒ¼ã‚«ãƒ«å¤‰æ•°ã¸ã‚³ãƒ”ー
x, y, width, height = args
string = args[4]
align = args[5].equal?(nil) ? 0 : args[5]
shadow_color = args[6].equal?(nil) ? Color.new(0, 0, 0) : args[6]
else
# 引数ãŒä¸æ£ãªã‚‰ã‚¨ãƒ©ãƒ¼ã‚’åã
raise(ArgumentError, "wrong number of arguments(#{args.size} of #{args.size < 5 ? 5 : 7})")
return
end
end
# å…ƒã®è‰²ã‚’ä¿å˜
origin_color = font.color.dup
# å½±æç”»
font.color = shadow_color
draw_text(x + 2, y + 2, width, height, string, align)
# å…ƒã®è‰²ã«æˆ»ã™
font.color = origin_color
draw_text(x, y, width, height, string, align)
end
end
#_/ â—†ç¸å–ã‚Šãƒ»å½±æ–‡å—æç”» ï¼ KGC_FrameShadowTextâ—†
#_/----------------------------------------------------------------------------
#_/ draw_text を強化ã—ã€ç¸å–りや影文å—ã®æç”»æ©Ÿèƒ½ã‚’è¿½åŠ ã—ã¾ã™ã€‚
#_/ Provides functions to draw texts which framed or dropped shadow.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
=begin
â”â”â”â”â” æè¼‰ãƒ¡ã‚½ãƒƒãƒ‰ - Methods â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”
┠─── Class - Bitmap ────────────────────────────
┃ draw_frame_text(x, y, width, height, string[, align, frame_color])
┃ draw_frame_text(rect, string[, align, frame_color])
┃ x, y : æç”»å…ˆåº§æ¨™ [Integer]
┃ Destination.
┃ width, height : æç”»ã‚µã‚¤ã‚º [Integer]
┃ Size.
┃ rect : æç”»é ˜åŸŸ [Rect]
┃ Rectangle.
┃ string : æç”»æ–‡å—列 [String]
┃ Output text.
┃ align : æ–‡å—æ•´åˆ—å½¢å¼ [Integer]
┃ Alignment.
┃ frame_color : ç¸å–り色 [Color]
┃ Frame color.
┃ 周りを frame_color ã§ç¸å–りã—ãŸæ–‡å—列をæç”»ã—ã¾ã™ã€‚
┃ Draws a character string framed in 'frame_color'.
┃
┃ draw_shadow_text(x, y, width, height, string[, align, frame_color])
┃ draw_shadow_text(rect, string[, align, frame_color])
┃ x, y : æç”»å…ˆåº§æ¨™ [Integer]
┃ Destination.
┃ width, height : æç”»ã‚µã‚¤ã‚º [Integer]
┃ Size.
┃ rect : æç”»é ˜åŸŸ [Rect]
┃ Rectangle.
┃ string : æç”»æ–‡å—列 [String]
┃ Output text.
┃ align : æ–‡å—æ•´åˆ—å½¢å¼ [Integer]
┃ Alignment.
┃ frame_color : ç¸å–り色 [Color]
┃ Frame color.
┃ å³ä¸‹ã«å½±ã‚’è½ã¨ã—ãŸæ–‡å—列をæç”»ã—ã¾ã™ã€‚
┃ Draws a character string which drops shadow to lower right.
┃
â”—â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”â”
=end
$imported = {} if $imported == nil
$imported["FrameShadowText"] = true
#==============================================================================
# â– Bitmap
#==============================================================================
class Bitmap
#--------------------------------------------------------------------------
# â— ç¸å–ã‚Šæ–‡å—æç”»
# x, y, width, height, string[, align, frame_color]
# rect, string[, align, frame_color]
#--------------------------------------------------------------------------
def draw_frame_text(*args)
# 引数判定
if args[0].is_a?(Rect)
if args.size >= 2 && args.size <= 4
# 引数を処ç†ç”¨ã®ãƒãƒ¼ã‚«ãƒ«å¤‰æ•°ã¸ã‚³ãƒ”ー
x, y = args[0].x, args[0].y
width, height = args[0].width, args[0].height
string = args[1]
align = args[2].equal?(nil) ? 0 : args[2]
frame_color = args[3].equal?(nil) ? Color.new(0, 0, 0) : args[3]
else
# 引数ãŒä¸æ£ãªã‚‰ã‚¨ãƒ©ãƒ¼ã‚’åã
raise(ArgumentError, "wrong number of arguments(#{args.size} of #{args.size < 2 ? 2 : 4})")
return
end
else
if args.size >= 5 && args.size <= 7
# 引数を処ç†ç”¨ã®ãƒãƒ¼ã‚«ãƒ«å¤‰æ•°ã¸ã‚³ãƒ”ー
x, y, width, height = args
string = args[4]
align = args[5].equal?(nil) ? 0 : args[5]
frame_color = args[6].equal?(nil) ? Color.new(0, 0, 0) : args[6]
else
# 引数ãŒä¸æ£ãªã‚‰ã‚¨ãƒ©ãƒ¼ã‚’åã
raise(ArgumentError, "wrong number of arguments(#{args.size} of #{args.size < 5 ? 5 : 7})")
return
end
end
# å…ƒã®è‰²ã‚’ä¿å˜
origin_color = font.color.dup
# ç¸å–り
font.color = frame_color
draw_text(x - 1, y - 1, width, height, string, align)
draw_text(x - 1, y + 1, width, height, string, align)
draw_text(x + 1, y - 1, width, height, string, align)
draw_text(x + 1, y + 1, width, height, string, align)
# å…ƒã®è‰²ã«æˆ»ã™
font.color = origin_color
draw_text(x, y, width, height, string, align)
end
#--------------------------------------------------------------------------
# â— å½±æ–‡å—æç”»
# x, y, width, height, string[, align, shadow_color]
# rect, string[, align, shadow_color]
#--------------------------------------------------------------------------
def draw_shadow_text(*args)
# 引数判定
if args[0].is_a?(Rect)
if args.size >= 2 && args.size <= 4
# 引数を処ç†ç”¨ã®ãƒãƒ¼ã‚«ãƒ«å¤‰æ•°ã¸ã‚³ãƒ”ー
x, y = args[0].x, args[0].y
width, height = args[0].width, args[0].height
string = args[1]
align = args[2].equal?(nil) ? 0 : args[2]
shadow_color = args[3].equal?(nil) ? Color.new(0, 0, 0) : args[3]
else
# 引数ãŒä¸æ£ãªã‚‰ã‚¨ãƒ©ãƒ¼ã‚’åã
raise(ArgumentError, "wrong number of arguments(#{args.size} of #{args.size < 2 ? 2 : 4})")
return
end
else
if args.size >= 5 && args.size <= 7
# 引数を処ç†ç”¨ã®ãƒãƒ¼ã‚«ãƒ«å¤‰æ•°ã¸ã‚³ãƒ”ー
x, y, width, height = args
string = args[4]
align = args[5].equal?(nil) ? 0 : args[5]
shadow_color = args[6].equal?(nil) ? Color.new(0, 0, 0) : args[6]
else
# 引数ãŒä¸æ£ãªã‚‰ã‚¨ãƒ©ãƒ¼ã‚’åã
raise(ArgumentError, "wrong number of arguments(#{args.size} of #{args.size < 5 ? 5 : 7})")
return
end
end
# å…ƒã®è‰²ã‚’ä¿å˜
origin_color = font.color.dup
# å½±æç”»
font.color = shadow_color
draw_text(x + 2, y + 2, width, height, string, align)
# å…ƒã®è‰²ã«æˆ»ã™
font.color = origin_color
draw_text(x, y, width, height, string, align)
end
end
Expand to see the code.
BMS Strings
Spoiler
=begin
These are strings to be used in JesseG88's Background
Message System.
You can easily modify the strings or create new ones.
Just put them inside module STRINGS.
Refer to [Background Message] for instructions.
=end
module STRINGS
BLANK = ""
HELLO1 = "If you were hoping to see World, preceded by Hello, too bad!"
HELLO2 = "Putting that in would be detrimental to my sanity."
RED_ALERT = "Red Alert! Red Alert! Enemy forces detected!"
BATTLE_STATIONS = "All hands to battle stations!"
end
These are strings to be used in JesseG88's Background
Message System.
You can easily modify the strings or create new ones.
Just put them inside module STRINGS.
Refer to [Background Message] for instructions.
=end
module STRINGS
BLANK = ""
HELLO1 = "If you were hoping to see World, preceded by Hello, too bad!"
HELLO2 = "Putting that in would be detrimental to my sanity."
RED_ALERT = "Red Alert! Red Alert! Enemy forces detected!"
BATTLE_STATIONS = "All hands to battle stations!"
end
Expand to see the code.
Background Message System
Spoiler
=begin
#=======================================
# ** Background Message System
#------------------------------------------------------------------------------
# JesseG88
# 1.0
# 2006-06-06
#=======================================
# This allows text to show up onscreen during the game
# without interrupting events. All event processing,
# including player input and "normal" messages will
# continue uninterrupted while text is displayed. This
# is useful for cutscenes, minigames, etc.
#=======================================
#=====================================
# Instructions
#=====================================
- Installation -
Place the strings file and the BMS file (this one) between
[Scene_Debug] and [Main]. Make sure to place the
strings ABOVE this file.
In addition, make sure to install [KGC_FrameShadowText]
or you will get an error.
- Making text strings -
Go into [BMS Strings] and look at the existing strings to see what
they should look like. You can create new strings easile by following
the format and keeping them in the strings module.
For example:
module STRINGS
STRING_NAME = "Text inside string"
end
=end
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Background Message System', 'JesseG88', '1.0', '2006-06-06')
#------------------------------------------------------------------------------
# Begin SDK Enabled Check
#------------------------------------------------------------------------------
if SDK.state('Background Message System') == true
module BMS
#Perform any customizations inside this module.
#Windowskin Opacity
WINDOW_OPACITY = 0
#Upper Left Corner
WINDOW_X1 = 0
WINDOW_Y1 = 0 #Set to 0 for top, 160 for middle, 320 for bottom.
#Window Size
WINDOW_X2 = 640
WINDOW_Y2 = 160
#Line 1 Settings
LINE1_FONT_FACE = "Arial"
LINE1_FONT_SIZE = 20
LINE1_FONT_BOLD = true
LINE1_FONT_ITALIC = false
LINE1_FONT_COLOR = Color.new(255, 255, 255, 255)
LINE1_FST_MODE = 0 # 0-Plain, 1-Frame, 2-Shadow
LINE1_STRING = STRINGS::BLANK
#Line 2 Settings
LINE2_FONT_FACE = "Arial"
LINE2_FONT_SIZE = 20
LINE2_FONT_BOLD = true
LINE2_FONT_ITALIC = false
LINE2_FONT_COLOR = Color.new(255, 255, 255, 255)
LINE2_FST_MODE = 0 # 0-Plain, 1-Frame, 2-Shadow
LINE2_STRING = STRINGS::BLANK
#Line 3 Settings
LINE3_FONT_FACE = "Arial"
LINE3_FONT_SIZE = 20
LINE3_FONT_BOLD = true
LINE3_FONT_ITALIC = false
LINE3_FONT_COLOR = Color.new(255, 255, 255, 255)
LINE3_FST_MODE = 0 # 0-Plain, 1-Frame, 2-Shadow
LINE3_STRING = STRINGS::BLANK
#Line 4 Settings
LINE4_FONT_FACE = "Arial"
LINE4_FONT_SIZE = 20
LINE4_FONT_BOLD = true
LINE4_FONT_ITALIC = false
LINE4_FONT_COLOR = Color.new(255, 255, 255, 255)
LINE4_FST_MODE = 0 # 0-Plain, 1-Frame, 2-Shadow
LINE4_STRING = STRINGS::BLANK
#Unless you know what you are doing,
#do not modify anything below this line.
end
class Window_BGMessage < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(BMS::WINDOW_X1, BMS::WINDOW_Y1, BMS::WINDOW_X2, BMS::WINDOW_Y2)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = BMS::WINDOW_OPACITY
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
#Collect settings from BMS module, then print text.
#Start of Line 1
self.contents.font.name = BMS::LINE1_FONT_FACE
self.contents.font.size = BMS::LINE1_FONT_SIZE
self.contents.font.bold = BMS::LINE1_FONT_BOLD
self.contents.font.italic = BMS::LINE1_FONT_ITALIC
self.contents.font.color = BMS::LINE1_FONT_COLOR
case BMS::LINE1_FST_MODE
when 0
self.contents.draw_text(0, 0, 608, 32, BMS::LINE1_STRING)
when 1
self.contents.draw_frame_text(0, 0, 608, 32, BMS::LINE1_STRING)
when 2
self.contents.draw_shadow_text(0, 0, 608, 32, BMS::LINE1_STRING)
end
#End of Line 1
#Start of Line 2
self.contents.font.name = BMS::LINE2_FONT_FACE
self.contents.font.size = BMS::LINE2_FONT_SIZE
self.contents.font.bold = BMS::LINE2_FONT_BOLD
self.contents.font.italic = BMS::LINE2_FONT_ITALIC
self.contents.font.color = BMS::LINE2_FONT_COLOR
case BMS::LINE2_FST_MODE
when 0
self.contents.draw_text(0, 32, 608, 32, BMS::LINE2_STRING)
when 1
self.contents.draw_frame_text(0, 32, 608, 32, BMS::LINE2_STRING)
when 2
self.contents.draw_shadow_text(0, 32, 608, 32, BMS::LINE2_STRING)
end
#End of Line 2
#Start of Line 3
self.contents.font.name = BMS::LINE3_FONT_FACE
self.contents.font.size = BMS::LINE3_FONT_SIZE
self.contents.font.bold = BMS::LINE3_FONT_BOLD
self.contents.font.italic = BMS::LINE3_FONT_ITALIC
self.contents.font.color = BMS::LINE3_FONT_COLOR
case BMS::LINE3_FST_MODE
when 0
self.contents.draw_text(0, 64, 608, 32, BMS::LINE3_STRING)
when 1
self.contents.draw_frame_text(0, 64, 608, 32, BMS::LINE3_STRING)
when 2
self.contents.draw_shadow_text(0, 64, 608, 32, BMS::LINE3_STRING)
end
#End of Line 3
#Start of Line 4
self.contents.font.name = BMS::LINE4_FONT_FACE
self.contents.font.size = BMS::LINE4_FONT_SIZE
self.contents.font.bold = BMS::LINE4_FONT_BOLD
self.contents.font.italic = BMS::LINE4_FONT_ITALIC
self.contents.font.color = BMS::LINE4_FONT_COLOR
case BMS::LINE4_FST_MODE
when 0
self.contents.draw_text(0, 128, 608, 32, BMS::LINE4_STRING)
when 1
self.contents.draw_frame_text(0, 128, 608, 32, BMS::LINE4_STRING)
when 2
self.contents.draw_shadow_text(0, 128, 608, 32, BMS::LINE4_STRING)
end
#End of Line 4
end #of def refresh
end #of class Window_BGMessage
end #of if SDK.state('Background Message System') == true
#------------------------------------------------------------------------------
# End SDK Enabled Test
#------------------------------------------------------------------------------
#=======================================
# ** Background Message System
#------------------------------------------------------------------------------
# JesseG88
# 1.0
# 2006-06-06
#=======================================
# This allows text to show up onscreen during the game
# without interrupting events. All event processing,
# including player input and "normal" messages will
# continue uninterrupted while text is displayed. This
# is useful for cutscenes, minigames, etc.
#=======================================
#=====================================
# Instructions
#=====================================
- Installation -
Place the strings file and the BMS file (this one) between
[Scene_Debug] and [Main]. Make sure to place the
strings ABOVE this file.
In addition, make sure to install [KGC_FrameShadowText]
or you will get an error.
- Making text strings -
Go into [BMS Strings] and look at the existing strings to see what
they should look like. You can create new strings easile by following
the format and keeping them in the strings module.
For example:
module STRINGS
STRING_NAME = "Text inside string"
end
=end
#------------------------------------------------------------------------------
# * SDK Log Script
#------------------------------------------------------------------------------
SDK.log('Background Message System', 'JesseG88', '1.0', '2006-06-06')
#------------------------------------------------------------------------------
# Begin SDK Enabled Check
#------------------------------------------------------------------------------
if SDK.state('Background Message System') == true
module BMS
#Perform any customizations inside this module.
#Windowskin Opacity
WINDOW_OPACITY = 0
#Upper Left Corner
WINDOW_X1 = 0
WINDOW_Y1 = 0 #Set to 0 for top, 160 for middle, 320 for bottom.
#Window Size
WINDOW_X2 = 640
WINDOW_Y2 = 160
#Line 1 Settings
LINE1_FONT_FACE = "Arial"
LINE1_FONT_SIZE = 20
LINE1_FONT_BOLD = true
LINE1_FONT_ITALIC = false
LINE1_FONT_COLOR = Color.new(255, 255, 255, 255)
LINE1_FST_MODE = 0 # 0-Plain, 1-Frame, 2-Shadow
LINE1_STRING = STRINGS::BLANK
#Line 2 Settings
LINE2_FONT_FACE = "Arial"
LINE2_FONT_SIZE = 20
LINE2_FONT_BOLD = true
LINE2_FONT_ITALIC = false
LINE2_FONT_COLOR = Color.new(255, 255, 255, 255)
LINE2_FST_MODE = 0 # 0-Plain, 1-Frame, 2-Shadow
LINE2_STRING = STRINGS::BLANK
#Line 3 Settings
LINE3_FONT_FACE = "Arial"
LINE3_FONT_SIZE = 20
LINE3_FONT_BOLD = true
LINE3_FONT_ITALIC = false
LINE3_FONT_COLOR = Color.new(255, 255, 255, 255)
LINE3_FST_MODE = 0 # 0-Plain, 1-Frame, 2-Shadow
LINE3_STRING = STRINGS::BLANK
#Line 4 Settings
LINE4_FONT_FACE = "Arial"
LINE4_FONT_SIZE = 20
LINE4_FONT_BOLD = true
LINE4_FONT_ITALIC = false
LINE4_FONT_COLOR = Color.new(255, 255, 255, 255)
LINE4_FST_MODE = 0 # 0-Plain, 1-Frame, 2-Shadow
LINE4_STRING = STRINGS::BLANK
#Unless you know what you are doing,
#do not modify anything below this line.
end
class Window_BGMessage < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(BMS::WINDOW_X1, BMS::WINDOW_Y1, BMS::WINDOW_X2, BMS::WINDOW_Y2)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = BMS::WINDOW_OPACITY
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
#Collect settings from BMS module, then print text.
#Start of Line 1
self.contents.font.name = BMS::LINE1_FONT_FACE
self.contents.font.size = BMS::LINE1_FONT_SIZE
self.contents.font.bold = BMS::LINE1_FONT_BOLD
self.contents.font.italic = BMS::LINE1_FONT_ITALIC
self.contents.font.color = BMS::LINE1_FONT_COLOR
case BMS::LINE1_FST_MODE
when 0
self.contents.draw_text(0, 0, 608, 32, BMS::LINE1_STRING)
when 1
self.contents.draw_frame_text(0, 0, 608, 32, BMS::LINE1_STRING)
when 2
self.contents.draw_shadow_text(0, 0, 608, 32, BMS::LINE1_STRING)
end
#End of Line 1
#Start of Line 2
self.contents.font.name = BMS::LINE2_FONT_FACE
self.contents.font.size = BMS::LINE2_FONT_SIZE
self.contents.font.bold = BMS::LINE2_FONT_BOLD
self.contents.font.italic = BMS::LINE2_FONT_ITALIC
self.contents.font.color = BMS::LINE2_FONT_COLOR
case BMS::LINE2_FST_MODE
when 0
self.contents.draw_text(0, 32, 608, 32, BMS::LINE2_STRING)
when 1
self.contents.draw_frame_text(0, 32, 608, 32, BMS::LINE2_STRING)
when 2
self.contents.draw_shadow_text(0, 32, 608, 32, BMS::LINE2_STRING)
end
#End of Line 2
#Start of Line 3
self.contents.font.name = BMS::LINE3_FONT_FACE
self.contents.font.size = BMS::LINE3_FONT_SIZE
self.contents.font.bold = BMS::LINE3_FONT_BOLD
self.contents.font.italic = BMS::LINE3_FONT_ITALIC
self.contents.font.color = BMS::LINE3_FONT_COLOR
case BMS::LINE3_FST_MODE
when 0
self.contents.draw_text(0, 64, 608, 32, BMS::LINE3_STRING)
when 1
self.contents.draw_frame_text(0, 64, 608, 32, BMS::LINE3_STRING)
when 2
self.contents.draw_shadow_text(0, 64, 608, 32, BMS::LINE3_STRING)
end
#End of Line 3
#Start of Line 4
self.contents.font.name = BMS::LINE4_FONT_FACE
self.contents.font.size = BMS::LINE4_FONT_SIZE
self.contents.font.bold = BMS::LINE4_FONT_BOLD
self.contents.font.italic = BMS::LINE4_FONT_ITALIC
self.contents.font.color = BMS::LINE4_FONT_COLOR
case BMS::LINE4_FST_MODE
when 0
self.contents.draw_text(0, 128, 608, 32, BMS::LINE4_STRING)
when 1
self.contents.draw_frame_text(0, 128, 608, 32, BMS::LINE4_STRING)
when 2
self.contents.draw_shadow_text(0, 128, 608, 32, BMS::LINE4_STRING)
end
#End of Line 4
end #of def refresh
end #of class Window_BGMessage
end #of if SDK.state('Background Message System') == true
#------------------------------------------------------------------------------
# End SDK Enabled Test
#------------------------------------------------------------------------------
Expand to see the code.
Instructions
Installation
Get the SDK, and all the scripts listed above. Place them in the following order in the editor:
- SDK
- KGC_FrameShadowText
- BMS Strings
- Background Message
Go into BMS strings and look at the example strings that are already in there. Adding a new string should be ridiculously easy.
Formatting the window
Go into Background Message and look at module BMS. (Lines 49-101) Simply change the attributes to suit your needs. You can even change the attirbutes in-game. Just add "BMS::", without quotes, to an attribute in an in-game script. It should similar to this:
BMS::LINE1_FST_MODE = 1
BMS::LINE1_FONT_COLOR = Color.new(255, 0, 0, 255)
BMS::LINE1_FONT_COLOR = Color.new(255, 0, 0, 255)
Expand to see the code.
Making the message appear in-game
Run a script like this:
BMS::LINE1_STRING = STRINGS::HELLO1
BMS::LINE2_STRING = STRINGS::HELLO2
@BGMessage = Window_BGMessage.new
BMS::LINE2_STRING = STRINGS::HELLO2
@BGMessage = Window_BGMessage.new
Expand to see the code.
The line BMS::LINE1_STRING = STRINGS::HELLO1 binds a text string to a line. Change the blue to the line you want to set, and the red text to the string ID you want to use. Note that for very short strings, you may just want to set the string text in the command itself, as in
BMS::LINE1_STRING = "Aluxus"
The line @BGMessage = Window_BGMessage.new causes the message to appear onscreen.
Removing a message
Run this script:
Note that if you want to change the message to display a different string, you will need to dispose the current message first before calling a new one. Otherwise, they will both show up at the same time and cause problems.
Compatibility
This script requires the SDK. It also needs KGC's Frame and Shadow Text script, which I included.
Bugs, Errors
If you call a message and dispose of it on a different page or event, you may get an error message. To avoid this, call the message and dispose of it on the same event page.
Credits and Thanks
SDK Team - SDK
KGC Software - Frame and Shadow Text script, as well as the idea of customization modules.
Author's Notes
This is the first script I have posted, so it may not be all that great.
I may post a demo later.