幻想森林

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1742|回复: 6

[RMXP] 怎样可以把文字竖着从上而下显示!

[复制链接]

38

主题

129

帖子

1151

积分

⑥精研

无既空,空既色

积分
1151
发表于 2010-1-18 23:56:19 | 显示全部楼层 |阅读模式
问下能不能把对话筐的文字竖着从上而下的显示,而不是横着显示
回复

使用道具 举报

0

主题

50

帖子

408

积分

④见习

腿神姐真的很温柔&

积分
408
QQ
发表于 2010-1-19 00:47:43 | 显示全部楼层
  1. class Window_Message
  2.   def initialize
  3.     super(380, 16, 160, 448)
  4.     self.contents = Bitmap.new(width - 32, height - 32)
  5.     self.visible = false
  6.     self.z = 9998
  7.     @fade_in = false
  8.     @fade_out = false
  9.     @contents_showing = false
  10.     @cursor_width = 0
  11.     self.active = false
  12.     self.index = -1
  13.   end
  14.   def refresh
  15.     self.contents.clear
  16.     self.contents.font.color = normal_color
  17.     x = y = 0
  18.     @cursor_width = 0
  19.     if $game_temp.choice_start == 0
  20.       x = 8
  21.     end
  22.     if $game_temp.message_text != nil
  23.       text = $game_temp.message_text
  24.       begin
  25.         last_text = text.clone
  26.         text.gsub!(/\\\\[Vv]\\[([0-9]+)\\]/) { $game_variables[$1.to_i] }
  27.       end until text == last_text
  28.       text.gsub!(/\\\\[Nn]\\[([0-9]+)\\]/) do
  29.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  30.       end
  31.       text.gsub!(/\\\\\\\\/) { "\\000" }
  32.       text.gsub!(/\\\\[Cc]\\[([0-9]+)\\]/) { "\\001[#{$1}]" }
  33.       text.gsub!(/\\\\[Gg]/) { "\\002" }
  34.       while ((c = text.slice!(/./m)) != nil)
  35.         if c == "\\000"
  36.           c = "\\\\"
  37.         end
  38.         if c == "\\001"
  39.           text.sub!(/\\[([0-9]+)\\]/, "")
  40.           color = $1.to_i
  41.           if color >= 0 and color <= 7
  42.             self.contents.font.color = text_color(color)
  43.           end
  44.           next
  45.         end
  46.         if c == "\\002"
  47.           if @gold_window == nil
  48.             @gold_window = Window_Gold.new
  49.             @gold_window.x = 560 - @gold_window.width
  50.             if $game_temp.in_battle
  51.               @gold_window.y = 192
  52.             else
  53.               @gold_window.y = self.y >= 128 ? 32 : 384
  54.             end
  55.             @gold_window.opacity = self.opacity
  56.             @gold_window.back_opacity = self.back_opacity
  57.           end
  58.           next
  59.         end
  60.         if c == "\\n"
  61.           if y >= $game_temp.choice_start
  62.             @cursor_width = [@cursor_width, x].max
  63.           end
  64.           x += 1
  65.           y = 0
  66.           if y >= $game_temp.choice_start
  67.             x = 8
  68.           end
  69.           next
  70.         end
  71.         self.contents.draw_text(-32 * x + 100, 4 + y, 40, 32, c)
  72.         y += self.contents.text_size(c).height
  73.       end
  74.     end
  75.     if $game_temp.choice_max > 0
  76.       @item_max = $game_temp.choice_max
  77.       self.active = true
  78.       self.index = 0
  79.     end
  80.     if $game_temp.num_input_variable_id > 0
  81.       digits_max = $game_temp.num_input_digits_max
  82.       number = $game_variables[$game_temp.num_input_variable_id]
  83.       @input_number_window = Window_InputNumber.new(digits_max)
  84.       @input_number_window.number = number
  85.       @input_number_window.x = self.x + 8
  86.       @input_number_window.y = self.y + $game_temp.num_input_start * 32
  87.     end
  88.   end
  89.   def reset_window
  90.     if $game_temp.in_battle
  91.       self.x = 464
  92.     else
  93.       case $game_system.message_position
  94.       when 0
  95.         self.x = 16
  96.       when 1
  97.         self.x = 240
  98.       when 2
  99.         self.x = 464
  100.       end
  101.     end
  102.     if $game_system.message_frame == 0
  103.       self.opacity = 255
  104.     else
  105.       self.opacity = 0
  106.     end
  107.     self.back_opacity = 160
  108.   end
  109. end
复制代码
效果很不错哟~~如果需要从左到右,搜索-32 * x + 100,改为x*32 + 4即可。这个是从右到左的~~~
http://www.diyrpg.net/bbs/index.php 欢迎大家来先行者论坛><
回复 支持 反对

使用道具 举报

38

主题

129

帖子

1151

积分

⑥精研

无既空,空既色

积分
1151
 楼主| 发表于 2010-1-19 12:48:18 | 显示全部楼层
晕,不行呀,我用上去到第三行的数字那里就出错了!
回复 支持 反对

使用道具 举报

0

主题

50

帖子

408

积分

④见习

腿神姐真的很温柔&

积分
408
QQ
发表于 2010-1-19 13:54:02 | 显示全部楼层
我测试时没有问题,你是不是用了别的对话框脚本?
http://www.diyrpg.net/bbs/index.php 欢迎大家来先行者论坛><
回复 支持 反对

使用道具 举报

38

主题

129

帖子

1151

积分

⑥精研

无既空,空既色

积分
1151
 楼主| 发表于 2010-1-19 14:04:42 | 显示全部楼层
那个不是单独用的吗
回复 支持 反对

使用道具 举报

38

主题

129

帖子

1151

积分

⑥精研

无既空,空既色

积分
1151
 楼主| 发表于 2010-1-19 14:05:23 | 显示全部楼层
我把原来的Window_Message删除了直接套上你的那个脚本的
回复 支持 反对

使用道具 举报

0

主题

50

帖子

408

积分

④见习

腿神姐真的很温柔&

积分
408
QQ
发表于 2010-1-19 14:13:05 | 显示全部楼层
原本的不用删,把这个插入到MAIN前面即可。除了有特殊说明外,基本上R界的脚本都是这么用的。
http://www.diyrpg.net/bbs/index.php 欢迎大家来先行者论坛><
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|幻想森林

GMT+8, 2024-5-22 02:58 , Processed in 0.020491 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表