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

Project1

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

[已经解决] 关于战斗显示对话和改变字体大小

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
0 小时
注册时间
2010-7-20
帖子
8
跳转到指定楼层
1
发表于 2010-7-20 18:32:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
VX怎样在战斗中显示对话?
另外怎样改变文章字体大小?
翻了半天论坛没找了 搜索过发现只有XP的脚本

Lv1.梦旅人

梦石
0
星屑
85
在线时间
424 小时
注册时间
2009-8-3
帖子
984
2
发表于 2010-7-20 22:07:30 | 只看该作者
战斗中显示对话用战斗事件就可以了,
在敌人队伍下面有编辑。。。
第二个还是自己翻的好,这里不提倡培养伸手党
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
0 小时
注册时间
2010-7-20
帖子
8
3
 楼主| 发表于 2010-7-20 22:49:33 | 只看该作者
本帖最后由 Windows7 于 2010-7-20 23:07 编辑

回复 wsmyzc 的帖子

翻不到呀
只有XP的脚本
我要的不是统一修改
只是修改个别字体大小
回复 支持 反对

使用道具 举报

Lv2.观梦者

神隐的主犯

梦石
0
星屑
258
在线时间
271 小时
注册时间
2008-2-22
帖子
7691

贵宾

4
发表于 2010-7-20 23:52:48 | 只看该作者
回复 Windows7 的帖子

在需要的地方写上:
  Font.size = XX;
XX 是数字, VX 默认是20.,值越大字越大。

在不需要的时候再改回来,
  Font.size = 20;

评分

参与人数 1星屑 +400 收起 理由
木葬枫 + 400 认可答案,66RPG感谢您的热情解答 ...

查看全部评分


《天空之城 —— 破碎的命运》
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
85
在线时间
424 小时
注册时间
2009-8-3
帖子
984
5
发表于 2010-7-21 08:54:03 | 只看该作者
本帖最后由 wsmyzc 于 2010-7-21 08:56 编辑

翻到了。。
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================

  4. =begin
  5. superufo版加强对话框
  6. 新增功能:
  7. 1.\h[X]:更改字号为X(X〈32)
  8. 2.\o[X]:更改透明度为X(模拟悄悄话?)
  9. 3.\u[XXXXXX]:直接以十六进制指定颜色
  10. 4.\i[X]:显示X号物品名
  11. 5.\s[X]:显示X号技能名
  12. 6.\w[X]:显示X号武器名
  13. 7.\a[X]:显示X号防具名
  14. 再加上原有功能
  15. 8.\c[X]:将颜色调整为X(0〈=X〈=15)
  16. 9.\n[X]:显示X号同伴名
  17. 10.\v[X]:显示X号变量
  18. 11.\g:显示金钱窗口
  19. 12.\.:停滞1/4秒
  20. 13.\|:停滞1秒
  21. 14.\!:等待输入???
  22. 15.\>:开启瞬间输入
  23. 16.\<:关闭瞬间输入
  24. 17.\^:等待输入的无???
  25. 18.\\:显示“\”这个符号
  26. 就是全部参数
  27. =end
  28. class Window_Message < Window_Selectable

  29.   MAX_LINE = 4                           

  30.   def initialize
  31.     super(0, 288, 544, 128)
  32.     self.z = 200
  33.     self.active = false
  34.     self.index = -1
  35.     self.openness = 0
  36.     @opening = false           
  37.     @closing = false           
  38.     @text = nil                 
  39.     @contents_x = 0           
  40.     @contents_y = 0         
  41.     @line_count = 0           
  42.     @wait_count = 0            
  43.     @background = 0            
  44.     @position = 2            
  45.     @show_fast = false        
  46.     @line_show_fast = false     
  47.     @pause_skip = false      
  48.     create_gold_window
  49.     create_number_input_window
  50.     create_back_sprite
  51.   end

  52.   def dispose
  53.     super
  54.     dispose_gold_window
  55.     dispose_number_input_window
  56.     dispose_back_sprite
  57.   end

  58.   def update
  59.     super
  60.     update_gold_window
  61.     update_number_input_window
  62.     update_back_sprite
  63.     update_show_fast
  64.     unless @opening or @closing        
  65.       if @wait_count > 0                  
  66.         @wait_count -= 1
  67.       elsif self.pause                     
  68.         input_pause
  69.       elsif self.active                    
  70.         input_choice
  71.       elsif @number_input_window.visible   
  72.         input_number
  73.       elsif @text != nil                  
  74.         update_message                     
  75.       elsif continue?                     
  76.         start_message                        
  77.         open                                
  78.         $game_message.visible = true
  79.       else                              
  80.         close                              
  81.         $game_message.visible = @closing
  82.       end
  83.     end
  84.   end

  85.   def create_gold_window
  86.     @gold_window = Window_Gold.new(384, 0)
  87.     @gold_window.openness = 0
  88.   end

  89.   def create_number_input_window
  90.     @number_input_window = Window_NumberInput.new
  91.     @number_input_window.visible = false
  92.   end

  93.   def create_back_sprite
  94.     @back_sprite = Sprite.new
  95.     @back_sprite.bitmap = Cache.system("MessageBack")
  96.     @back_sprite.visible = (@background == 1)
  97.     @back_sprite.z = 190
  98.   end

  99.   def dispose_gold_window
  100.     @gold_window.dispose
  101.   end

  102.   def dispose_number_input_window
  103.     @number_input_window.dispose
  104.   end

  105.   def dispose_back_sprite
  106.     @back_sprite.dispose
  107.   end

  108.   def update_gold_window
  109.     @gold_window.update
  110.   end

  111.   def update_number_input_window
  112.     @number_input_window.update
  113.   end

  114.   def update_back_sprite
  115.     @back_sprite.visible = (@background == 1)
  116.     @back_sprite.y = y - 16
  117.     @back_sprite.opacity = openness
  118.     @back_sprite.update
  119.   end

  120.   def update_show_fast
  121.     if self.pause or self.openness < 255
  122.       @show_fast = false
  123.     elsif Input.trigger?(Input::C) and @wait_count < 2
  124.       @show_fast = true
  125.     elsif not Input.press?(Input::C)
  126.       @show_fast = false
  127.     end
  128.     if @show_fast and @wait_count > 0
  129.       @wait_count -= 1
  130.     end
  131.   end

  132.   def continue?
  133.     return true if $game_message.num_input_variable_id > 0
  134.     return false if $game_message.texts.empty?
  135.     if self.openness > 0 and not $game_temp.in_battle
  136.       return false if @background != $game_message.background
  137.       return false if @position != $game_message.position
  138.     end
  139.     return true
  140.   end

  141.   def start_message
  142.     @text = ""
  143.     for i in 0...$game_message.texts.size
  144.       @text += "  " if i >= $game_message.choice_start
  145.       @text += $game_message.texts[i].clone + "\x00"
  146.     end
  147.     @item_max = $game_message.choice_max
  148.     convert_special_characters
  149.     reset_window
  150.     new_page
  151.   end

  152.   def new_page
  153.     contents.clear
  154.     if $game_message.face_name.empty?
  155.       @contents_x = 0
  156.     else
  157.       name = $game_message.face_name
  158.       index = $game_message.face_index
  159.       draw_face(name, index, 0, 0)
  160.       @contents_x = 112
  161.     end
  162.     @contents_y = 0
  163.     @line_count = 0
  164.     @show_fast = false
  165.     @line_show_fast = false
  166.     @pause_skip = false
  167.     contents.font.color = text_color(0)
  168.   end

  169.   def new_line
  170.     if $game_message.face_name.empty?
  171.       @contents_x = 0
  172.     else
  173.       @contents_x = 112
  174.     end
  175.     @contents_y += WLH
  176.     @line_count += 1
  177.     @line_show_fast = false
  178.   end

  179.   def convert_special_characters
  180.     @text.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
  181.     @text.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
  182.     @text.gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }
  183.     @text.gsub!(/\\I\[([0-9]+)\]/i) { $data_items[$1.to_i].name }
  184.     @text.gsub!(/\\S\[([0-9]+)\]/i) { $data_skills[$1.to_i].name }
  185.     @text.gsub!(/\\W\[([0-9]+)\]/i) { $data_weapons[$1.to_i].name }
  186.     @text.gsub!(/\\A\[([0-9]+)\]/i) { $data_armors[$1.to_i].name }
  187.     @text.gsub!(/\\C\[([0-9]+)\]/i) { "\x01[#{$1}]" }
  188.     @text.gsub!(/\\G/)              { "\x02" }
  189.     @text.gsub!(/\\\./)             { "\x03" }
  190.     @text.gsub!(/\\\|/)             { "\x04" }
  191.     @text.gsub!(/\\!/)              { "\x05" }
  192.     @text.gsub!(/\\>/)              { "\x06" }
  193.     @text.gsub!(/\\</)              { "\x07" }
  194.     @text.gsub!(/\\\^/)             { "\x08" }
  195.     @text.gsub!(/\\O\[([0-9]+)\]/i) { "\x09[#{$1}]" }
  196.     @text.gsub!(/\\H\[([0-9]+)\]/i) { "\x10[#{$1}]" }
  197.     @text.gsub!(/\\U\[([0-9A-Fa-f]{6})\]/) { "\x11[#{$1}]" }
  198.     @text.gsub!(/\\\\/)             { "\\" }
  199.   end

  200.   def reset_window
  201.     @background = $game_message.background
  202.     @position = $game_message.position
  203.     if @background == 0   
  204.       self.opacity = 255
  205.     else                 
  206.       self.opacity = 0
  207.     end
  208.     case @position
  209.     when 0
  210.       self.y = 0
  211.       @gold_window.y = 360
  212.     when 1  
  213.       self.y = 144
  214.       @gold_window.y = 0
  215.     when 2  
  216.       self.y = 288
  217.       @gold_window.y = 0
  218.     end
  219.   end

  220.   def terminate_message
  221.     self.active = false
  222.     self.pause = false
  223.     self.index = -1
  224.     @gold_window.close
  225.     @number_input_window.active = false
  226.     @number_input_window.visible = false
  227.     $game_message.main_proc.call if $game_message.main_proc != nil
  228.     $game_message.clear
  229.   end

  230.   def update_message
  231.     loop do
  232.       c = @text.slice!(/./m)         
  233.       case c
  234.       when nil                        
  235.         finish_message                  
  236.         break
  237.       when "\x00"                       
  238.         new_line
  239.         if @line_count >= MAX_LINE     
  240.           unless @text.empty?         
  241.             self.pause = true           
  242.             break
  243.           end
  244.         end
  245.       when "\x01"                     
  246.         @text.sub!(/\[([0-9]+)\]/, "")
  247.         contents.font.color = text_color($1.to_i)
  248.         next
  249.       when "\x02"                     
  250.         @gold_window.refresh
  251.         @gold_window.open
  252.       when "\x03"                       
  253.         @wait_count = 15
  254.         break
  255.       when "\x04"                    
  256.         @wait_count = 60
  257.         break
  258.       when "\x05"                     
  259.         self.pause = true
  260.         break
  261.       when "\x06"                     
  262.         @line_show_fast = true
  263.       when "\x07"                     
  264.         @line_show_fast = false
  265.       when "\x08"                     
  266.         @pause_skip = true
  267.       when "\x09"
  268.         @text.sub!(/\[([0-9]+)\]/, "")
  269.         self.contents.font.color.alpha = [[0, $1.to_i].max, 255].min
  270.         next
  271.       when "\x10"
  272.         @text.sub!(/\[([0-9]+)\]/, "")
  273.         self.contents.font.size = [[$1.to_i, 6].max, 32].min
  274.         next
  275.       when "\x11"
  276.         @text.sub!(/\[([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})\]/, "")
  277.         self.contents.font.color = Color.new($1.to_i(16), $2.to_i(16), $3.to_i(16), 255)
  278.         next
  279.       else                             
  280.         contents.draw_text(@contents_x, @contents_y, 40, 32, c)
  281.         c_width = contents.text_size(c).width
  282.         @contents_x += c_width
  283.       end
  284.       break unless @show_fast or @line_show_fast
  285.     end
  286.   end

  287.   def finish_message
  288.     if $game_message.choice_max > 0
  289.       start_choice
  290.     elsif $game_message.num_input_variable_id > 0
  291.       start_number_input
  292.     elsif @pause_skip
  293.       terminate_message
  294.     else
  295.       self.pause = true
  296.     end
  297.     @wait_count = 10
  298.     @text = nil
  299.   end

  300.   def start_choice
  301.     self.active = true
  302.     self.index = 0
  303.   end

  304.   def start_number_input
  305.     digits_max = $game_message.num_input_digits_max
  306.     number = $game_variables[$game_message.num_input_variable_id]
  307.     @number_input_window.digits_max = digits_max
  308.     @number_input_window.number = number
  309.     if $game_message.face_name.empty?
  310.       @number_input_window.x = x
  311.     else
  312.       @number_input_window.x = x + 112
  313.     end
  314.     @number_input_window.y = y + @contents_y
  315.     @number_input_window.active = true
  316.     @number_input_window.visible = true
  317.     @number_input_window.update
  318.   end

  319.   def update_cursor
  320.     if @index >= 0
  321.       x = $game_message.face_name.empty? ? 0 : 112
  322.       y = ($game_message.choice_start + @index) * WLH
  323.       self.cursor_rect.set(x, y, contents.width - x, WLH)
  324.     else
  325.       self.cursor_rect.empty
  326.     end
  327.   end

  328.   def input_pause
  329.     if Input.trigger?(Input::B) or Input.trigger?(Input::C)
  330.       self.pause = false
  331.       if @text != nil and not @text.empty?
  332.         new_page if @line_count >= MAX_LINE
  333.       else
  334.         terminate_message
  335.       end
  336.     end
  337.   end

  338.   def input_choice
  339.     if Input.trigger?(Input::B)
  340.       if $game_message.choice_cancel_type > 0
  341.         Sound.play_cancel
  342.         $game_message.choice_proc.call($game_message.choice_cancel_type - 1)
  343.         terminate_message
  344.       end
  345.     elsif Input.trigger?(Input::C)
  346.       Sound.play_decision
  347.       $game_message.choice_proc.call(self.index)
  348.       terminate_message
  349.     end
  350.   end

  351.   def input_number
  352.     if Input.trigger?(Input::C)
  353.       Sound.play_decision
  354.       $game_variables[$game_message.num_input_variable_id] =
  355.         @number_input_window.number
  356.       $game_map.need_refresh = true
  357.       terminate_message
  358.     end
  359.   end
  360. end


  361. #==============================================================================
  362. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  363. #==============================================================================
复制代码

评分

参与人数 1星屑 +300 收起 理由
木葬枫 + 300 认可答案,66RPG感谢您的热情解答 ...

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
0 小时
注册时间
2010-7-20
帖子
8
6
 楼主| 发表于 2010-7-21 10:43:57 | 只看该作者
回复 wsmyzc 的帖子
非常感谢

我测试下



   
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2010-7-18
帖子
58
7
发表于 2010-7-21 17:23:44 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
85
在线时间
424 小时
注册时间
2009-8-3
帖子
984
8
发表于 2010-7-21 17:40:01 | 只看该作者
回复 q375430574 的帖子


    没有说的话就插入MAIN之前,我也不记得了
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
51
在线时间
1 小时
注册时间
2010-7-21
帖子
180
9
发表于 2010-7-22 12:01:43 | 只看该作者
应该是插入到main之前,

楼主不厚道,伸手党
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
7 小时
注册时间
2010-8-16
帖子
114
10
发表于 2010-8-23 19:09:41 | 只看该作者
回复 魔女真利亞 的帖子

能说明具体写在哪里吗?Font.size = XX这句 谢谢
   
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-3 21:46

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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