○檢視:
#==============================================================================
#----------------------------------------------------------------------------
# ○ OSD - 腳本討論社
# Originality RGSS Discuss
# └http://guild.gamer.com.tw/guild.php?sn=4707
#----------------------------------------------------------------------------
#==============================================================================
#--------------------------------------------------------------------------
# ● 腳本名稱:字體描繪追加
#--------------------------------------------------------------------------
# ● 腳本效果:
# 在一般描繪字體中追加一些特殊功能。
#--------------------------------------------------------------------------
# ● 腳本版本:1.01 版
#--------------------------------------------------------------------------
# ● 腳本更新區塊:
# 1.01版
# └修正無法用 Window_Message 內建指令更改文字顏色 bug
# └新增可更改光暈顏色的功能
#--------------------------------------------------------------------------
#==============================================================================
#----------------------------------------------------------------------------
# ○ OSD - 腳本討論社
# Originality RGSS Discuss
# └http://guild.gamer.com.tw/guild.php?sn=4707
#----------------------------------------------------------------------------
#==============================================================================
○使用方法:
#================================
○函式類
#================================
※※※※※※※※※※※※※※※※※※※※
draw_frame_text(x, y, width, height, text, align = 0)
描繪有邊框的字
※※※※※※※※※※※※※※※※※※※※
draw_light_text(x, y, width, height, text, align = 0)
描繪有光暈的字
※※※※※※※※※※※※※※※※※※※※
#================================
○變數類
#================================
※※※※※※※※※※※※※※※※※※※※
frame_color
可更改邊框顏色
※※※※※※※※※※※※※※※※※※※※
shadow_ox / shadow_oy
可更改陰影位移的多寡, shadow_ox 更改 X 座標, shadow_oy 更改 Y 座標
※※※※※※※※※※※※※※※※※※※※
shadow_ok
是否開啟陰影效果, true 是 / false 否
※※※※※※※※※※※※※※※※※※※※
#==============================================================================
#----------------------------------------------------------------------------
# ○ OSD - 腳本討論社
# Originality RGSS Discuss
# └http://guild.gamer.com.tw/guild.php?sn=4707
#----------------------------------------------------------------------------
#==============================================================================
#--------------------------------------------------------------------------
# ● 腳本名稱:字體描繪追加
#--------------------------------------------------------------------------
# ● 腳本效果:
# 在一般描繪字體中追加一些特殊功能。
#--------------------------------------------------------------------------
# ● 腳本版本:1.01 版
#--------------------------------------------------------------------------
# ● 腳本更新區塊:
# 1.01版
# └修正無法用 Window_Message 內建指令更改文字顏色 bug
# └新增可更改光暈顏色的功能
#--------------------------------------------------------------------------
#==============================================================================
#----------------------------------------------------------------------------
# ○ OSD - 腳本討論社
# Originality RGSS Discuss
# └http://guild.gamer.com.tw/guild.php?sn=4707
#----------------------------------------------------------------------------
#==============================================================================
○使用方法:
#================================
○函式類
#================================
※※※※※※※※※※※※※※※※※※※※
draw_frame_text(x, y, width, height, text, align = 0)
描繪有邊框的字
※※※※※※※※※※※※※※※※※※※※
draw_light_text(x, y, width, height, text, align = 0)
描繪有光暈的字
※※※※※※※※※※※※※※※※※※※※
#================================
○變數類
#================================
※※※※※※※※※※※※※※※※※※※※
frame_color
可更改邊框顏色
※※※※※※※※※※※※※※※※※※※※
shadow_ox / shadow_oy
可更改陰影位移的多寡, shadow_ox 更改 X 座標, shadow_oy 更改 Y 座標
※※※※※※※※※※※※※※※※※※※※
shadow_ok
是否開啟陰影效果, true 是 / false 否
※※※※※※※※※※※※※※※※※※※※
※※※※※※※※※※※※※※※※※※※※
light_color
light_color
可更改光暈顏色
※※※※※※※※※※※※※※※※※※※※
○腳本檢視:
○腳本檢視:
#============================================================================== #---------------------------------------------------------------------------- # ○ OSD - 腳本討論社 # Originality RGSS Discuss # └http://guild.gamer.com.tw/guild.php?sn=4707 #---------------------------------------------------------------------------- #============================================================================== #-------------------------------------------------------------------------- # ● 腳本名稱:字體描繪追加 #-------------------------------------------------------------------------- # ● 腳本效果: # 在一般描繪字體中追加一些特殊功能。 #-------------------------------------------------------------------------- # ● 腳本版本:1.01 版 #-------------------------------------------------------------------------- # ● 腳本更新區塊: # 1.01版 # └修正無法用 Window_Message 內建指令更改文字顏色 bug # └新增可更改光暈顏色的功能 #-------------------------------------------------------------------------- #============================================================================== #---------------------------------------------------------------------------- # ○ OSD - 腳本討論社 # Originality RGSS Discuss # └http://guild.gamer.com.tw/guild.php?sn=4707 #---------------------------------------------------------------------------- #============================================================================== #============================================================================== # ■ Bitmap #------------------------------------------------------------------------------ # 處理圖像的類別 #============================================================================== class Bitmap #-------------------------------------------------------------------------- # ● 定義實例變量 #-------------------------------------------------------------------------- attr_accessor :shadow_ox # 陰影 X 座標位移像素 attr_accessor :shadow_oy # 陰影 Y 座標位移像素 attr_accessor :shadow_ok # 陰影文字的開關 attr_accessor :shadow_color # 陰影文字陰影顏色 attr_accessor :frame_color # 邊框文字邊框顏色 #-------------------------------------------------------------------------- # ● 初始化目標 #-------------------------------------------------------------------------- alias initialize_osd initialize def initialize(*args) initialize_osd(*args) @shadow_ox = 2 @shadow_oy = 2 @shadow_ok = true @shadow_color = Color.new(0, 0, 0, 200) @frame_color = Color.new(0, 0, 0, 255) end #-------------------------------------------------------------------------- # ● 修正原本描繪字體,增加陰影 #-------------------------------------------------------------------------- alias draw_text_old draw_text def draw_text(*args) # 獲取參數 if args[0].is_a?(Rect) rect = args[0] text = args[1].to_s align = args[2].to_i text_x, text_y, text_width, text_height = rect.x, rect.y, rect.width, rect.height else text_x, text_y, text_width, text_height = args[0...4] text, align = args[4].to_s, args[5].to_i end # 如果有開啟陰影 if @shadow_ok # 設定顏色 font.color = @shadow_color # 描繪陰影 draw_text_old(text_x + @shadow_ox, text_y + @shadow_oy, text_width, text_height, text, align) # 還原顏色 font.color = Font.default_color end # 描繪原本字體 draw_text_old(*args) end #-------------------------------------------------------------------------- # ● 邊框描繪函式 #-------------------------------------------------------------------------- def draw_frame_text(x, y, width, height, text, align = 0) text_o, align_o = text.to_s, align.to_i # 設定顏色 font.color = @frame_color # 描繪圈框 draw_text_old(x - 1, y, width, height, text_o, align_o) draw_text_old(x, y - 1, width, height, text_o, align_o) draw_text_old(x + 1, y, width, height, text_o, align_o) draw_text_old(x, y + 1, width, height, text_o, align_o) draw_text_old(x + 1, y + 1, width, height, text_o, align_o) draw_text_old(x - 1, y - 1, width, height, text_o, align_o) draw_text_old(x + 1, y - 1, width, height, text_o, align_o) draw_text_old(x - 1, y + 1, width, height, text_o, align_o) # 還原顏色 font.color = Font.default_color draw_text_old(x, y, width, height, text_o, align_o) end #-------------------------------------------------------------------------- # ● 光暈描繪函式 #-------------------------------------------------------------------------- def draw_light_text(x, y, width, height, text, align = 0) text_o, align_o = text.to_s, align.to_i (1...4).each {|i| # 設定顏色 font.color.alpha = font.size * 3 - i * font.size move = i # 描繪黑框 draw_text_old(x - move, y, width, height, text_o, align_o) draw_text_old(x, y - move, width, height, text_o, align_o) draw_text_old(x + move, y, width, height, text_o, align_o) draw_text_old(x, y + move, width, height, text_o, align_o) draw_text_old(x + move, y + move, width, height, text_o, align_o) draw_text_old(x - move, y - move, width, height, text_o, align_o) draw_text_old(x + move, y - move, width, height, text_o, align_o) draw_text_old(x - move, y + move, width, height, text_o, align_o) } # 還原顏色透明度 font.color.alpha = 255 draw_text_old(x, y, width, height, text_o, align_o) end end |
○畫面
○範例下載:
└ 下載點 1
└ 下載點 2