查看: 1602|回复: 2

[有事请教] 想文本框扩充文字,文字字数有点不够用了

[复制链接]
梦石
0
星屑
1442
在线时间
171 小时
注册时间
2019-10-4
回帖
162
发表于 2024-2-25 00:23:28 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
QQ浏览器截图20240225001852.png

素材区好人

梦石
5
星屑
12559
在线时间
4345 小时
注册时间
2011-7-21
回帖
2264

超评测参与极短28参与极短27参与极短26参与极短25参与极短24参与极短23参与极短22参与极短21参与

发表于 2024-2-25 06:50:12 | 显示全部楼层
随便找的加长文章脚本,这种脚本其实有好多
11.png 12.png
[fold=加长文章][pre lang="ruby"]#============================================================================
# ■ 续行符文章连辍显示 by SailCat
#============================================================================
class Window_Message
alias sailcat_refresh refresh
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
   lines = 0
   $game_temp.message_text.each {lines += 1}
   lines = 4 if lines < 4
   self.height = lines * 32 + 32
   self.contents = Bitmap.new(width - 32, height - 32)
   reset_window
   sailcat_refresh
end
#--------------------------------------------------------------------------
# ● 设置窗口位置与不透明度
#--------------------------------------------------------------------------
def reset_window
   if $game_temp.in_battle
     self.y = 16
   else
     case $game_system.message_position
     when 0  # 上
       self.y = 16
     when 1  # 中
       self.y = 240 - self.height / 2
     when 2  # 下
       self.y = 464 - self.height
     end
   end
   if $game_system.message_frame == 0
     self.opacity = 255
   else
     self.opacity = 0
   end
   self.back_opacity = 160
end
end
class Interpreter
#--------------------------------------------------------------------------
# ● 显示文章
#--------------------------------------------------------------------------
def command_101
   # 另外的文章已经设置过 message_text 的情况下
   if $game_temp.message_text != nil
     # 结束
     return false
   end
   # 设置信息结束后待机和返回调用标志
   @message_waiting = true
   $game_temp.message_proc = Proc.new { @message_waiting = false }
   # message_text 设置为 1 行
   $game_temp.message_text = @list[@index].parameters[0] + "\n"
   line_count = 1
   # 最大 4 行
   line_max = 1
   # 循环
   loop do
     # 下一个事件指令为文章两行以上的情况
     if @list[@index+1].code == 401
       # message_text 添加到第 2 行以下
       $game_temp.message_text += @list[@index+1].parameters[0] + "\n"
       line_count += 1
     # 下一个事件指令为显示文章,且本行末尾有续行标记的情况
     elsif @list[@index+1].code == 101 and @list[@index].parameters[0][-2, 2] == " _"
       # 如果已经达到 12 行就返回
       if line_count == 12
         # 清除续行标记
         $game_temp.message_text.gsub!(/ _$/, "")
         # 继续
         return true
       end
       # message_text 添加到第 2 行以下
       $game_temp.message_text += @list[@index+1].parameters[0] + "\n"
       line_count += 1
       # 增加 4 行空间,最多 12 行
       line_max += 4 if line_max < 12
     # 事件指令不在文章两行以下的情况
     else
       # 如果本行末尾有续行标记则增加到 12 行
       if @list[@index].parameters[0][-2, 2] == " _"
         line_max = 12
       end
       # 下一个事件指令为显示选择项的情况下
       if @list[@index+1].code == 102
         # 如果选择项能收纳在画面里
         if @list[@index+1].parameters[0].size <= line_max - line_count
           # 推进索引
           @Index += 1
           # 设置选择项
           $game_temp.choice_start = line_count
           setup_choices(@list[@index].parameters)
         end
       # 下一个事件指令为处理输入数值的情况下
       elsif @list[@index+1].code == 103 and
         # 如果数值输入窗口能收纳在画面里
         if line_count < line_max
           # 推进索引
           @index += 1
           # 设置输入数值
           $game_temp.num_input_start = line_count
           $game_temp.num_input_variable_id = @list[@index].parameters[0]
           $game_temp.num_input_digits_max = @list[@index].parameters[1]
         end
       end
       # 清除续行标记
       $game_temp.message_text.gsub!(/ _$/, "")
       # 继续
       return true
     end
     # 推进索引
     @index += 1
   end
end
end[/pre][/fold]

点评

点赞 好评+1  发表于 2024-2-25 12:18
回复 1 0

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部