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

Project1

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

[已经过期] 关于对话框脚本的问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
59 小时
注册时间
2013-12-22
帖子
78
跳转到指定楼层
1
发表于 2014-5-3 13:03:27 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 a65868886 于 2014-5-10 00:07 编辑

我在网上看到了一个关于对话框的脚本,谁能告诉我这个要怎么用QWQ
RUBY 代码复制
  1. #------------------------------------------------------------------------------#
  2. #  Galv's Message Background
  3. #------------------------------------------------------------------------------#
  4. #  For: RPGMAKER VX ACE
  5. #  Version 1.3
  6. #------------------------------------------------------------------------------#
  7. #  2013-04-01 - version 1.2 - added option to disable script in battle
  8. #  2013-02-10 - version 1.1 - dim and transparent settings work with image now
  9. #  2012-12-02 - version 1.0 - release
  10. #------------------------------------------------------------------------------#
  11. #  This script displays an image file for a message background instead of using
  12. #  the windowskin. If you are using Galv's Message Busts put this script ABOVE.
  13. #
  14. #  This image background will not stretch to fit, that's not it's purpose.
  15. #  I encourage you to make your own message background images, the ones in the
  16. #  demo are just quick examples!
  17. #------------------------------------------------------------------------------#
  18. #  INSTRUCTIONS:
  19. #  Put in script list below Materials and above Main.
  20. #
  21. #  Read the instructions
  22. #------------------------------------------------------------------------------#
  23. #  SCRIPT CALL
  24. #------------------------------------------------------------------------------#
  25. #  
  26. #  msgbg("ImageName", y_offset)     # To change message background during game
  27. #                                   # "ImageName" is the new file name to use
  28. #                                   # y_offset is the new IMAGE_Y for that bg
  29. #  EXAMPLE
  30. #  msgbg("MsgImage", -98)      
  31. #
  32. #------------------------------------------------------------------------------#
  33.  
  34. ($imported ||= {})["Galvs_Message_Background"] = true
  35. module Galv_Msgbg
  36.  
  37. #------------------------------------------------------------------------------#
  38. #  SCRIPT SETTINGS
  39. #------------------------------------------------------------------------------#
  40.  
  41.   # DEFAULT MESSAGE #
  42.  
  43.   MESSAGE_IMAGE = "MsgImage"   # Name of image in /Graphics/System to use for
  44.                                # the message background.
  45.  
  46.   IMAGE_Y = -98                # Y offset of image
  47.  
  48.   DISABLE_SWITCH = 1   # Turn swith ON to disable image background
  49.  
  50.   DISABLE_IN_BATTLE = true  # Disable this script when in battle.
  51.  
  52.  
  53. #------------------------------------------------------------------------------#
  54. #  END SCRIPT SETTINGS
  55. #------------------------------------------------------------------------------#
  56.  
  57. end
  58.  
  59.  
  60. class Window_Message < Window_Base
  61.   alias galv_msgbg_window_create_back_bitmap create_back_bitmap
  62.   def create_back_bitmap
  63.     @bg ||= Sprite.new
  64.     if !$game_message.message_bg.nil?
  65.       @bg.bitmap = Cache.system($game_message.message_bg)
  66.       @current_bg = $game_message.message_bg
  67.     end
  68.     @bg.z = z - 1
  69.     @bg.opacity = 0
  70.     galv_msgbg_window_create_back_bitmap
  71.   end
  72.  
  73.   alias galv_msgbg_window_dispose dispose
  74.   def dispose
  75.     galv_msgbg_window_dispose
  76.     dispose_msgbg if !@bg.nil?
  77.   end
  78.  
  79.   def dispose_msgbg
  80.     @bg.dispose
  81.     @bg.bitmap.dispose
  82.   end
  83.  
  84.   alias galv_msgbg_window_update_back_sprite update_back_sprite
  85.   def update_back_sprite
  86.     if !$game_switches[Galv_Msgbg::DISABLE_SWITCH] && !$game_temp.msg_off
  87.       update_msgbg if openness > 0
  88.       @bg.opacity = 0 if openness == 0
  89.     else
  90.       galv_msgbg_window_update_back_sprite
  91.       @bg.opacity = 0
  92.     end
  93.     @bg.update
  94.     @back_sprite.update
  95.   end
  96.  
  97.   def update_msgbg
  98.     if $game_message.message_bg != @current_bg
  99.       if !$game_message.message_bg.nil?
  100.         @bg.bitmap = Cache.system($game_message.message_bg)
  101.         @current_bg = $game_message.message_bg
  102.       end
  103.     end
  104.     @bg.y = self.y + $game_message.message_bg_y
  105.     case @background
  106.     when 0; @bg.opacity = openness
  107.     when 1; @bg.opacity = openness * 0.5
  108.     when 2; @bg.opacity = 0
  109.     end
  110.     @back_sprite.visible = false
  111.     self.opacity = 0
  112.   end
  113.  
  114. end # Window_Message < Window_Base
  115.  
  116. class Game_Message
  117.   attr_accessor :message_bg
  118.   attr_accessor :message_bg_y
  119.  
  120.   alias galv_msgbg_message_initialize initialize
  121.   def initialize
  122.     galv_msgbg_message_initialize
  123.     @message_bg = Galv_Msgbg::MESSAGE_IMAGE
  124.     @message_bg_y = Galv_Msgbg::IMAGE_Y
  125.   end
  126. end # Game_Message
  127.  
  128. class Game_Temp
  129.   attr_accessor :msg_off
  130. end # Game_Temp
  131.  
  132. class Scene_Battle < Scene_Base
  133.   alias galv_msgbg_sb_start start
  134.   def start
  135.     $game_temp.msg_off = true if Galv_Msgbg::DISABLE_IN_BATTLE
  136.     galv_msgbg_sb_start
  137.   end
  138.  
  139.   alias galv_msgbg_sb_terminate terminate
  140.   def terminate
  141.     $game_temp.msg_off = nil
  142.     galv_msgbg_sb_terminate
  143.   end
  144. end # Scene_Battle < Scene_Base
  145.  
  146. class Game_Interpreter
  147.   def msgbg(image,y_offset)
  148.     $game_message.message_bg = image
  149.     $game_message.message_bg_y = y_offset
  150.   end
  151. end # Game_Interpreter

Lv3.寻梦者 (版主)

…あたしは天使なんかじゃないわ

梦石
0
星屑
2208
在线时间
4033 小时
注册时间
2010-10-4
帖子
10779

开拓者贵宾

2
发表于 2014-5-3 14:20:21 | 只看该作者
本帖最后由 taroxd 于 2014-5-3 14:25 编辑

#------------------------------------------------------------------------------#
#  SCRIPT CALL
#------------------------------------------------------------------------------#
#  
#  msgbg("ImageName", y_offset)     # To change message background during game
#                                   # "ImageName" is the new file name to use
#                                   # y_offset is the new IMAGE_Y for that bg
#  EXAMPLE
#  msgbg("MsgImage", -98)      
#
#------------------------------------------------------------------------------#

这段不是写得很清楚么。同一个问题问4遍,而且都有正确的回答,真不知道该说啥好……
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
86 小时
注册时间
2013-7-17
帖子
61
3
发表于 2014-5-3 14:21:32 | 只看该作者
直接插入到main前。。还有命名为MsgImage。。我是这么弄的。。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
59 小时
注册时间
2013-12-22
帖子
78
4
 楼主| 发表于 2014-5-3 15:21:30 | 只看该作者
月初雪姬 发表于 2014-5-3 14:21
直接插入到main前。。还有命名为MsgImage。。我是这么弄的。。

那你有范例能给我看看嘛QWQ我不知道要怎么做
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
59 小时
注册时间
2013-12-22
帖子
78
5
 楼主| 发表于 2014-5-3 15:22:33 | 只看该作者
taroxd 发表于 2014-5-3 14:20
#------------------------------------------------------------------------------#
#  SCRIPT CALL
#--- ...

不好意思啦对不起麻烦你回答那么多次QWQ我是知道说明书在哪,但是不知道对话框的图片要怎么做
就是不知道是要单个画出对话框还是画四个格子那样的
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
86 小时
注册时间
2013-7-17
帖子
61
6
发表于 2014-5-3 15:47:59 | 只看该作者
本帖最后由 月初雪姬 于 2014-5-3 15:52 编辑
a65868886 发表于 2014-5-3 15:21
那你有范例能给我看看嘛QWQ我不知道要怎么做


我只能说........这根本不需要范例啦。。你一个问题发几个贴= == =无语死

评分

参与人数 1星屑 +1 收起 理由
taroxd + 1 我很赞同

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
86 小时
注册时间
2013-7-17
帖子
61
7
发表于 2014-5-3 15:51:26 | 只看该作者
本帖最后由 月初雪姬 于 2014-5-3 15:55 编辑
月初雪姬 发表于 2014-5-3 15:47
我只能说........这根本不需要范例啦。。你一个问题发几个贴= =http://pan.baidu.com/s/1bnxkO83 = =无语 ...


如果图片要覆满对话框的话。。大小改。。(什么覆满嘛!我语文死的早)
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
59 小时
注册时间
2013-12-22
帖子
78
8
 楼主| 发表于 2014-5-3 16:25:18 | 只看该作者
月初雪姬 发表于 2014-5-3 15:47
我只能说........这根本不需要范例啦。。你一个问题发几个贴= == =无语死

大概是怎样的啦QAQ你能给我详细的解释或上个图什么的吗QAQ
非常感激!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
86 小时
注册时间
2013-7-17
帖子
61
9
发表于 2014-5-3 16:55:22 | 只看该作者
a65868886 发表于 2014-5-3 16:25
大概是怎样的啦QAQ你能给我详细的解释或上个图什么的吗QAQ
非常感激!

等下!你是要哪种的?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
59 小时
注册时间
2013-12-22
帖子
78
10
 楼主| 发表于 2014-5-3 17:07:10 | 只看该作者
月初雪姬 发表于 2014-5-3 16:55
等下!你是要哪种的?

就是命名为MSGIMAGE的那个图片是什么

点评

那只是个例子,要替换成自己用素材文件,  发表于 2014-5-3 22:02
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-22 07:24

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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