设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3176|回复: 2
打印 上一主题 下一主题

[已经解决] Window_Message中文字显示位置在哪?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
120
在线时间
92 小时
注册时间
2009-8-1
帖子
438
跳转到指定楼层
1
发表于 2010-9-3 16:11:03 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 tree52 于 2010-9-4 20:25 编辑

  我没有找到对话框文字位置、选项时的文字位置,我只找到了对话框、光标的位置。能帮我看一下是在哪里改么?谢了!
附:脚本
  1. #==============================================================================
  2. # ■ Window_Message
  3. #------------------------------------------------------------------------------
  4. #  显示文章的信息窗口。
  5. #==============================================================================
  6. class Window_Message < Window_Selectable
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化状态
  9.   #--------------------------------------------------------------------------
  10.   def initialize
  11.     super(80, 304, 480, 160) #(80, 304, 480, 160)
  12.     self.contents = Bitmap.new(width - 32, height - 32)
  13.     self.visible = false
  14.     self.z = 9998
  15.     @fade_in = false
  16.     @fade_out = false
  17.     @contents_showing = false
  18.     @cursor_width = 0
  19.     self.active = false
  20.     self.index = -1
  21.   end
  22.   #--------------------------------------------------------------------------
  23.   # ● 释放
  24.   #--------------------------------------------------------------------------
  25.   def dispose
  26.     terminate_message
  27.     $game_temp.message_window_showing = false
  28.     if @input_number_window != nil
  29.       @input_number_window.dispose
  30.     end
  31.     super
  32.   end
  33.   #--------------------------------------------------------------------------
  34.   # ● 处理信息结束
  35.   #--------------------------------------------------------------------------
  36.   def terminate_message
  37.     self.active = false
  38.     self.pause = false
  39.     self.index = -1
  40.     self.contents.clear
  41.     # 清除显示中标志
  42.     @contents_showing = false
  43.     # 呼叫信息调用
  44.     if $game_temp.message_proc != nil
  45.       $game_temp.message_proc.call
  46.     end
  47.     # 清除文章、选择项、输入数值的相关变量
  48.     $game_temp.message_text = nil
  49.     $game_temp.message_proc = nil
  50.     $game_temp.choice_start = 99
  51.     $game_temp.choice_max = 0
  52.     $game_temp.choice_cancel_type = 0
  53.     $game_temp.choice_proc = nil
  54.     $game_temp.num_input_start = 99
  55.     $game_temp.num_input_variable_id = 0
  56.     $game_temp.num_input_digits_max = 0
  57.     # 开放金钱窗口
  58.     if @gold_window != nil
  59.       @gold_window.dispose
  60.       @gold_window = nil
  61.     end
  62.   end
  63.   #--------------------------------------------------------------------------
  64.   # ● 刷新
  65.   #--------------------------------------------------------------------------
  66.   def refresh
  67.     self.contents.clear
  68.     self.contents.font.color = normal_color
  69.     x = y = 0
  70.     @cursor_width = 0
  71.     # 到选择项的下一行字
  72.     if $game_temp.choice_start == 0
  73.       x = 8
  74.     end
  75.     # 有等待显示的文字的情况下
  76.     if $game_temp.message_text != nil
  77.       text = $game_temp.message_text
  78.       # 限制文字处理
  79.       begin
  80.         last_text = text.clone
  81.         text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  82.       end until text == last_text
  83.       text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  84.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  85.       end
  86.       # 为了方便、将 "[url=]\\\\[/url]" 变换为 "\000"
  87.       text.gsub!(/\\\\/) { "\000" }
  88.       # "[url=file://\\C]\\C[/url]" 变为 "\001" に、"[url=file://\\G]\\G[/url]" 变为 "\002"
  89.       text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  90.       text.gsub!(/\\[Gg]/) { "\002" }
  91.       # c 获取 1 个字 (如果不能取得文字就循环)
  92.       while ((c = text.slice!(/./m)) != nil)
  93.         # \\ 的情况下
  94.         if c == "\000"
  95.           # 还原为本来的文字
  96.           c = "\\"
  97.         end
  98.         # \C[n] 的情况下
  99.         if c == "\001"
  100.           # 更改文字色
  101.           text.sub!(/\[([0-9]+)\]/, "")
  102.           color = $1.to_i
  103.           if color >= 0 and color <= 7
  104.             self.contents.font.color = text_color(color)
  105.           end
  106.           # 下面的文字
  107.           next
  108.         end
  109.         # \G 的情况下
  110.         if c == "\002"
  111.           # 生成金钱窗口
  112.           if @gold_window == nil
  113.             @gold_window = Window_Gold.new
  114.             @gold_window.x = 560 - @gold_window.width
  115.             if $game_temp.in_battle
  116.               @gold_window.y = 192
  117.             else
  118.               @gold_window.y = self.y >= 128 ? 32 : 384
  119.             end
  120.             @gold_window.opacity = self.opacity
  121.             @gold_window.back_opacity = self.back_opacity
  122.           end
  123.           # 下面的文字
  124.           next
  125.         end
  126.         # 另起一行文字的情况下
  127.         if c == "\n"
  128.           # 刷新选择项及光标的高
  129.           if y >= $game_temp.choice_start
  130.             @cursor_width = [@cursor_width, x].max
  131.           end
  132.           # y 加 1
  133.           y += 1
  134.           x = 0
  135.           # 移动到选择项的下一行
  136.           if y >= $game_temp.choice_start
  137.             x = 8
  138.           end
  139.           # 下面的文字
  140.           next
  141.         end
  142.         # 描绘文字
  143.         self.contents.draw_text(4 + x, 32 * y, 40, 32, c)
  144.         # x 为要描绘文字的加法运算
  145.         x += self.contents.text_size(c).width
  146.       end
  147.     end
  148.     # 选择项的情况
  149.     if $game_temp.choice_max > 0
  150.       @item_max = $game_temp.choice_max
  151.       self.active = true
  152.       self.index = 0
  153.     end
  154.     # 输入数值的情况
  155.     if $game_temp.num_input_variable_id > 0
  156.       digits_max = $game_temp.num_input_digits_max
  157.       number = $game_variables[$game_temp.num_input_variable_id]
  158.       @input_number_window = Window_InputNumber.new(digits_max)
  159.       @input_number_window.number = number
  160.       @input_number_window.x = self.x + 8
  161.       @input_number_window.y = self.y + $game_temp.num_input_start * 32
  162.     end
  163.   end
  164.   #--------------------------------------------------------------------------
  165.   # ● 设置窗口位置与不透明度
  166.   #--------------------------------------------------------------------------
  167.   def reset_window
  168.     if $game_temp.in_battle
  169.       self.y = 16
  170.     else
  171.       case $game_system.message_position
  172.       when 0  # 上
  173.         self.y = 16
  174.       when 1  # 中
  175.         self.y = 160
  176.       when 2  # 下
  177.         self.y = 304
  178.       end
  179.     end
  180.     if $game_system.message_frame == 0
  181.       self.opacity = 255
  182.     else
  183.       self.opacity = 0
  184.     end
  185.     self.back_opacity = 160
  186.   end
  187.   #--------------------------------------------------------------------------
  188.   # ● 刷新画面
  189.   #--------------------------------------------------------------------------
  190.   def update
  191.     super
  192.     # 渐变的情况下
  193.     if @fade_in
  194.       self.contents_opacity += 24
  195.       if @input_number_window != nil
  196.         @input_number_window.contents_opacity += 24
  197.       end
  198.       if self.contents_opacity == 255
  199.         @fade_in = false
  200.       end
  201.       return
  202.     end
  203.     # 输入数值的情况下
  204.     if @input_number_window != nil
  205.       @input_number_window.update
  206.       # 确定
  207.       if Input.trigger?(Input::C)
  208.         $game_system.se_play($data_system.decision_se)
  209.         $game_variables[$game_temp.num_input_variable_id] =
  210.           @input_number_window.number
  211.         $game_map.need_refresh = true
  212.         # 释放输入数值窗口
  213.         @input_number_window.dispose
  214.         @input_number_window = nil
  215.         terminate_message
  216.       end
  217.       return
  218.     end
  219.     # 显示信息中的情况下
  220.     if @contents_showing
  221.       # 如果不是在显示选择项中就显示暂停标志
  222.       if $game_temp.choice_max == 0
  223.         self.pause = true
  224.       end
  225.       # 取消
  226.       if Input.trigger?(Input::B)
  227.         if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  228.           $game_system.se_play($data_system.cancel_se)
  229.           $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  230.           terminate_message
  231.         end
  232.       end
  233.       # 确定
  234.       if Input.trigger?(Input::C)
  235.         if $game_temp.choice_max > 0
  236.           $game_system.se_play($data_system.decision_se)
  237.           $game_temp.choice_proc.call(self.index)
  238.         end
  239.         terminate_message
  240.       end
  241.       return
  242.     end
  243.     # 在渐变以外的状态下有等待显示的信息与选择项的场合
  244.     if @fade_out == false and $game_temp.message_text != nil
  245.       @contents_showing = true
  246.       $game_temp.message_window_showing = true
  247.       reset_window
  248.       refresh
  249.       Graphics.frame_reset
  250.       self.visible = true
  251.       self.contents_opacity = 0
  252.       if @input_number_window != nil
  253.         @input_number_window.contents_opacity = 0
  254.       end
  255.       @fade_in = true
  256.       return
  257.     end
  258.     # 没有可以显示的信息、但是窗口为可见的情况下
  259.     if self.visible
  260.       @fade_out = true
  261.       self.opacity -= 48
  262.       if self.opacity == 0
  263.         self.visible = false
  264.         @fade_out = false
  265.         $game_temp.message_window_showing = false
  266.       end
  267.       return
  268.     end
  269.   end
  270.   #--------------------------------------------------------------------------
  271.   # ● 刷新光标矩形
  272.   #--------------------------------------------------------------------------
  273.   def update_cursor_rect
  274.     if @index >= 0
  275.       n = $game_temp.choice_start + @index
  276.       self.cursor_rect.set(8, n * 32, @cursor_width, 32)
  277.     else
  278.       self.cursor_rect.empty
  279.     end
  280.   end
  281. end

复制代码
哎呦,好像快要能发布一款游戏了,这次一定要低调!
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
80
在线时间
3 小时
注册时间
2006-10-4
帖子
199
2
发表于 2010-9-3 16:57:12 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
120
在线时间
92 小时
注册时间
2009-8-1
帖子
438
3
 楼主| 发表于 2010-9-3 23:48:16 | 只看该作者
本帖最后由 tree52 于 2010-9-4 20:26 编辑

回复 hongqizhen 的帖子


    谢谢!我先试试再给你回复、认可哈。
======================================
  已经试过了,谢谢!结贴。
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-9 05:46

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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