Project1

标题: 对话框如何随时改左改右?就像更改文章上中下的一样。 [打印本页]

作者: 爆焰    时间: 2011-9-1 00:13
标题: 对话框如何随时改左改右?就像更改文章上中下的一样。
  我修改了对话框的位置,但是它只能固定在某个点,请问有啥办法可以随时改左改右显示对话框?dsu_plus_rewardpost_czw
作者: 各种压力的猫君    时间: 2011-9-1 01:08
本帖最后由 各种压力的猫君 于 2011-9-1 02:53 编辑

参考默认脚本 用一个变量控制。

Interpreter 3 约129-143行
  1.   #--------------------------------------------------------------------------
  2.   # ● 更改文章选项
  3.   #--------------------------------------------------------------------------
  4.   def command_104
  5.     # 正在显示信息的情况下
  6.     if $game_temp.message_window_showing
  7.       # 结束
  8.       return false
  9.     end
  10.     # 更改各个选项
  11.     $game_system.message_position = @parameters[0]
  12.     $game_system.message_frame = @parameters[1]
  13.     # 继续
  14.     return true
  15.   end
复制代码
Window_Message 约165-180行
  1.   #--------------------------------------------------------------------------
  2.   # ● 设置窗口位置与不透明度
  3.   #--------------------------------------------------------------------------
  4.   def reset_window
  5.     if $game_temp.in_battle
  6.       self.y = 16
  7.     else
  8.       case $game_system.message_position
  9.       when 0  # 上
  10.         self.y = 16
  11.       when 1  # 中
  12.         self.y = 160
  13.       when 2  # 下
  14.         self.y = 304
  15.       end
  16.     end
复制代码
参考这两个地方。
具体怎么改自己摸索下别来问我 = =
一没悬赏二没态度怎么看怎么是伸手党 咱可没那么好心帮你改 ╮(╯_╰)╭
作者: 癫狂侠客    时间: 2011-9-1 09:33
伸手党是应该严惩的,不过某侠看在你在别的帖子里有帮助别人的做法,这次帮你了!
在默认的Window_Message的168行(改过或者用了别的对话框脚本就自己看看对应位子)插入一行:
    $game_switches[1] ? self.x = 0: self.x = 160
开关一打开靠左,开关一关闭靠右.看图吧!




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1