| 赞 | 59 |
| VIP | |
| 好人卡 | |
| 积分 | 88 |
| 经验 | |
| 最后登录 | 2024-2-2 |
| 在线时间 | 501 小时 |
- 梦石
- 2
- 星屑
- 6767
- 在线时间
- 501 小时
- 注册时间
- 2018-3-23
- 回帖
- 487

|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
为了能在对话等文本中用上一些奇葩效果……让您的排版瞬间混乱的Qraizer文本系统出现了!(口胡
截图
Quazier系统实例
脚本[pre lang="ruby"]#==============================================================================
# Qrazier 文本系统 V1.0
#------------------------------------------------------------------------------
# 作者:MCCF 最后更新时间:2020/04/19
#==============================================================================
# - [简要概述]
#------------------------------------------------------------------------------
# - Qrazier 是一个用于实现奇特(且通常无用)的文本效果的系统。
#==============================================================================
# - [使用说明]
#------------------------------------------------------------------------------
# - 在对话等文本中使用文本可以给文本附加加粗效果。
# - 在对话等文本中使用文本可以给文本附加斜体效果。
# - 在对话等文本中使用文本可以给文本附加下划线效果。
# - 在对话等文本中使用文本可以给文本附加删除线效果。
#==============================================================================
# - [使用规约]
#------------------------------------------------------------------------------
# - 只要署名MCCF,即可在符合当地法规及其它规约的情况下,自由使用于任何游戏中。
#==============================================================================
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中所有窗口的父类
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● 获取划线宽度
#--------------------------------------------------------------------------
def qrazier_line_width
return 1
end
#--------------------------------------------------------------------------
# ● 文字的处理
#--------------------------------------------------------------------------
alias qrazier_process_character process_character
def process_character(c, text, pos)
if c == "[" && text[/^(\/?[A-Z]+)\]/i]
process_qrazier_character($1, text, pos)
else
last_pos = pos.dup
qrazier_process_character(c, text, pos)
process_underline(c, last_pos) if last_pos[:text_underline]
process_strike(c, last_pos) if last_pos[:text_strike]
end
end
#--------------------------------------------------------------------------
# ● CRA控制符的处理
#--------------------------------------------------------------------------
def process_qrazier_character(code, text, pos)
if code.slice!(/^\//)
case code.upcase
when 'B'
contents.font.bold = false
text.slice!(/^\/?[A-Z]+\]/i)
when 'I'
contents.font.italic = false
text.slice!(/^\/?[A-Z]+\]/i)
when 'U'
pos[:text_underline] = false
text.slice!(/^\/?[A-Z]+\]/i)
when 'S'
pos[:text_strike] = false
text.slice!(/^\/?[A-Z]+\]/i)
end
else
case code.upcase
when 'B'
contents.font.bold = true
text.slice!(/^\/?[A-Z]+\]/i)
when 'I'
contents.font.italic = true
text.slice!(/^\/?[A-Z]+\]/i)
when 'U'
pos[:text_underline] = true
text.slice!(/^\/?[A-Z]+\]/i)
when 'S'
pos[:text_strike] = true
text.slice!(/^\/?[A-Z]+\]/i)
end
end
end
#--------------------------------------------------------------------------
# ● 处理下划线
#--------------------------------------------------------------------------
def process_underline(char, pos)
text_width = text_size(char).width
line_color = contents.font.color
pos_x = pos[:x] + 0
pos_y = pos[:y] + contents.font.size
contents.fill_rect(pos_x, pos_y, text_width, qrazier_line_width, line_color)
end
#--------------------------------------------------------------------------
# ● 处理删除线
#--------------------------------------------------------------------------
def process_strike(char, pos)
text_width = text_size(char).width
line_color = contents.font.color
pos_x = pos[:x] + 0
pos_y = pos[:y] + line_height / 2
contents.fill_rect(pos_x, pos_y, text_width, qrazier_line_width, line_color)
end
end[/pre] |
评分
-
查看全部评分
|