| 赞 | 15 |
| VIP | |
| 好人卡 | |
| 积分 | 3 |
| 经验 | |
| 最后登录 | 2022-8-25 |
| 在线时间 | 2355 小时 |
- 梦石
- 0
- 星屑
- 266
- 在线时间
- 2355 小时
- 注册时间
- 2009-3-13
- 回帖
- 2257

|
发表于 2014-2-27 22:22:27
|
显示全部楼层
你用这个吧,直接输入 \k 换行
- class Window_Base
-
- def process_character(c, text, pos)
- case c
- when "\r"
- return
- when "\n"
- process_new_line(text, pos) if !@auto_n
- when "\f"
- process_new_page(text, pos)
- when "\e"
- process_escape_character(obtain_escape_code(text), text, pos)
- else
- process_normal_character(c,text,pos)
- end
- end
-
- def process_escape_character(code, text, pos)
- case code.upcase
- when 'C'
- change_color(text_color(obtain_escape_param(text)))
- when 'I'
- process_draw_icon(obtain_escape_param(text), pos)
- when '{'
- make_font_bigger
- when '}'
- make_font_smaller
- when 'K'
- process_new_line(text, pos)
- end
- end
-
- def process_normal_character(c,text,pos)
- @auto_n = true
- text_width = text_size(c).width
- if real_width - pos[:x] > text_width
- draw_text(pos[:x], pos[:y], text_width * 2, pos[:height], c)
- pos[:x] += text_width
- else
- process_new_line(text,pos)
- process_normal_character(c,text,pos)
- end
- end
-
- def real_width
- return self.width - 2 * standard_padding
- end
-
- end
-
- class Window_Message
-
- def process_normal_character(c,text,pos)
- super
- wait_for_one_character
- end
-
- end
复制代码 |
|