幻想森林

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
12
返回列表 发新帖
楼主: form-ei

[求助]谁可以帮我整合这两个脚本...

[复制链接]

91

主题

3188

帖子

83986万

积分

荣誉群

传说中的Bunny大神~!

积分
839861514
QQ
发表于 2006-10-10 15:50:04 | 显示全部楼层
整合中。。。
其他所有的Bunny神都素我的部下XD~ 小教程范例收集 Orz感谢邪恶萝卜联盟!!!(原因自己去猜)
回复 支持 反对

使用道具 举报

90

主题

785

帖子

1278万

积分

版主

Rank: 7Rank: 7Rank: 7

积分
12786515
QQ
 楼主| 发表于 2006-10-11 16:26:26 | 显示全部楼层
还没好吗??? [s:6]
回复 支持 反对

使用道具 举报

38

主题

3468

帖子

1

积分

超级版主

传说中的Bunny火神~!

Rank: 8Rank: 8

积分
1
发表于 2006-10-11 16:28:30 | 显示全部楼层
引用第11楼form-ei2006-10-11 16:26发表的“”:
还没好吗??? [s:6]

此人生病了,由我来代替……
我突然发现,我是一个很幸运的好人。老婆真好~ 点我进入JQ(激情)教程范例收集!
回复 支持 反对

使用道具 举报

90

主题

785

帖子

1278万

积分

版主

Rank: 7Rank: 7Rank: 7

积分
12786515
QQ
 楼主| 发表于 2006-10-11 16:38:27 | 显示全部楼层
引用第12楼杀鸡四天王2006-10-11 16:28发表的“”:


此人生病了,由我来代替……



[s:5] 我晕。。。要是我知道哪里冲突了我就自己来了。。。。

ps:脚本程度太低了。。。。
回复 支持 反对

使用道具 举报

38

主题

3468

帖子

1

积分

超级版主

传说中的Bunny火神~!

Rank: 8Rank: 8

积分
1
发表于 2006-10-11 21:16:26 | 显示全部楼层
试着整合了一下。
  1. #==============================================================================
  2. # ■ New!Window_Message
  3. # 作者 Ekarazis   
  4. class Game_Temp
  5. attr_accessor :need_show_more
  6. attr_accessor :window_pos_y
  7. attr_accessor :choices
  8. #------------------------------------------------------------------------------
  9. class Window_Message < Window_Selectable
  10. #--------------------------------------------------------------------------
  11. # ● 初始化状态
  12. #--------------------------------------------------------------------------
  13. def initialize
  14.   super(80, 304, 480, 160)
  15.   self.contents = Bitmap.new(width - 32, height - 32)
  16.   self.visible = false
  17.   self.z = 9998
  18.   @need_show_more = false
  19.   @window_pos_y = 16
  20.   @choices = nil
  21.   @fade_in = false
  22.   @fade_out = false
  23.   @contents_showing = false
  24.   @cursor_width = 0
  25.   self.active = false
  26.   self.index = -1
  27.   if $game_system.soundname_on_speak == nil then
  28.     $game_system.soundname_on_speak = ""
  29.   end
  30.   @opacity_text_buf = Bitmap.new(32, 32)
  31. end
  32. #--------------------------------------------------------------------------
  33. # ● 释放
  34. #--------------------------------------------------------------------------
  35. def dispose
  36.   terminate_message
  37.   $game_temp.message_window_showing = false
  38.   if @input_number_window != nil
  39.     @input_number_window.dispose
  40.   end
  41.   super
  42. end
  43. #--------------------------------------------------------------------------
  44. # ● 处理信息结束
  45. #--------------------------------------------------------------------------
  46. def terminate_message
  47.   self.active = false
  48.   self.pause = false
  49.   self.index = -1
  50.   self.contents.clear
  51.   # 清除显示中标志
  52.   @contents_showing = false
  53.   # 呼叫信息调用
  54.   if $game_temp.message_proc != nil
  55.     $game_temp.message_proc.call
  56.   end
  57.   # 清除文章、选择项、输入数值的相关变量
  58.   $game_temp.message_text = nil
  59.   $game_temp.message_proc = nil
  60.   $game_temp.choice_start = 99
  61.   $game_temp.choice_max = 0
  62.   $game_temp.choice_cancel_type = 0
  63.   $game_temp.choice_proc = nil
  64.   $game_temp.num_input_start = 99
  65.   $game_temp.num_input_variable_id = 0
  66.   $game_temp.num_input_digits_max = 0
  67.   # 开放金钱窗口
  68.   if @gold_window != nil
  69.     @gold_window.dispose
  70.     @gold_window = nil
  71.   end
  72.   if @name_window_frame != nil
  73.     @name_window_frame.dispose
  74.     @name_window_frame = nil
  75.   end
  76.   if @name_window_text != nil
  77.     @name_window_text.dispose
  78.     @name_window_text = nil
  79.   end
  80.   if @right_picture != nil and @right_keep == true
  81.     @right_picture.dispose
  82.   end   
  83.   if @left_picture != nil and @left_keep == true
  84.     @left_picture.dispose
  85.   end
  86. end
  87. def refresh
  88.   # 初期化
  89.   self.contents.clear
  90.   self.contents.font.color = normal_color
  91.   self.contents.font.size = Font.default_size
  92.   @x = @y = @max_x = @max_y = @indent = @lines = 0
  93.   @left_keep = @right_keep = false
  94.   @face_indent = 0
  95.   @opacity = 255
  96.   @cursor_width = 0
  97.   @write_speed = 0
  98.   @write_wait = 0
  99.   @mid_stop = false
  100.   @face_file = nil
  101.   @popchar = -2
  102.   if $game_temp.choice_start == 0
  103.     @x = 8
  104.   end
  105.   if $game_temp.need_show_more
  106.     self.y = $game_temp.window_pos_y
  107.     self.height = 160 + 32 * ($game_temp.choice_max - 4)
  108.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  109.   else
  110.     self.height = 160
  111.     self.contents = Bitmap.new(self.width - 32, self.height - 32)
  112.   end
  113.   if $game_temp.message_text != nil
  114.     @now_text = $game_temp.message_text
  115.     #——头像设置
  116.     if (/\\\\[Ff]\\[(.+?)\\]/.match(@now_text))!=nil then
  117.     @face_file = $1 + ".png"
  118.     @x = @face_indent = 128
  119.     if FileTest.exist?("Graphics/Pictures/" + $1 + ".png")
  120.       self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
  121.     end
  122.     @now_text.gsub!(/\\\\[Ff]\\[(.*?)\\]/) { "" }
  123.     end
  124.     #——左半身像设置
  125.     if (/\\\\[Ll]\\[(.+?)\\]/.match(@now_text))!=nil then
  126.     @face = $1 + ".png"
  127.     if $加密 == true
  128.       if @left_picture != nil
  129.         @left_picture.dispose
  130.       end
  131.       @left_picture = Sprite.new
  132.       @left_picture.bitmap = Bitmap.new("Graphics/Pictures/#{@face}")
  133.       @left_picture.y = 210
  134.       @left_picture.x = 80
  135.       @left_picture.mirror = true
  136.       @now_text.gsub!(/\\\\[Ll]\\[(.*?)\\]/) { "" }
  137.     else      
  138.       if FileTest.exist?("Graphics/Pictures/#{@face}")
  139.         if @left_picture != nil
  140.         @left_picture.dispose
  141.         end
  142.         @left_picture = Sprite.new
  143.         @left_picture.bitmap = Bitmap.new("Graphics/Pictures/#{@face}")
  144.         @left_picture.y = 210
  145.         @left_picture.x = 80
  146.         @left_picture.mirror = true
  147.         @now_text.gsub!(/\\\\[Ll]\\[(.*?)\\]/) { "" }
  148.       end
  149.     end     
  150.     end
  151.     #——右半身像设置
  152.     if (/\\\\[Rr]\\[(.+?)\\]/.match(@now_text))!=nil then
  153.     @face = "_" + $1 + "_h.png"
  154.     if $加密 == true
  155.       if @right_picture != nil
  156.         @right_picture.dispose
  157.       end
  158.       @right_picture = Sprite.new
  159.       @right_picture.bitmap = Bitmap.new("Graphics/Pictures/#{@face}")
  160.       @right_picture.y = 480-@right_picture.bitmap.height
  161.       @right_picture.x = 640-@right_picture.bitmap.width
  162.       @now_text.gsub!(/\\\\[Rr]\\[(.*?)\\]/) { "" }
  163.     else
  164.       if FileTest.exist?("Graphics/Pictures/#{@face}")
  165.         if @right_picture != nil
  166.         @right_picture.dispose
  167.         end
  168.         @right_picture = Sprite.new
  169.         @right_picture.bitmap = Bitmap.new("Graphics/Pictures/#{@face}")
  170.         @right_picture.y = 480-@right_picture.bitmap.height
  171.         @right_picture.x = 640-@right_picture.bitmap.width
  172.         @now_text.gsub!(/\\\\[Rr]\\[(.*?)\\]/) { "" }
  173.       end
  174.     end
  175.     end
  176.     if (/\\\\[Rr]k/.match(@now_text)) != nil
  177.     @right_keep = true
  178.     @now_text.sub!(/\\\\[Rr]k/) { "" }
  179.     end
  180.     if (/\\\\[Ll]k/.match(@now_text)) != nil
  181.     @left_keep = true
  182.     @now_text.sub!(/\\\\[Ll]k/) { "" }
  183.     end
  184.     # 显示人物姓名
  185.     name_window_set = false
  186.     if (/\\\\[Nn]ame\\[(.+?)\\]/.match(@now_text)) != nil
  187.     name_window_set = true
  188.     name_text = $1
  189.     @now_text.sub!(/\\\\[Nn]ame\\[(.*?)\\]/) { "" }
  190.     end
  191.    
  192.     # 文字位置的判定
  193.     if (/\\\\[Pp]\\[([-1,0-9]+)\\]/.match(@now_text))!=nil then
  194.     @popchar = $1.to_i
  195.     if @popchar == -1
  196.       @x = @indent = 48
  197.       @y = 4
  198.     end
  199.     @now_text.gsub!(/\\\\[Pp]\\[([-1,0-9]+)\\]/) { "" }
  200.     end
  201.    
  202.     # 开始
  203.     begin
  204.     last_text = @now_text.clone
  205.     @now_text.gsub!(/\\\\[Vv]\\[([IiWwAaSs]?)([0-9]+)\\]/) { convart_value($1, $2.to_i) }
  206.     end until @now_text == last_text
  207.     @now_text.gsub!(/\\\\[Nn]\\[([0-9]+)\\]/) do
  208.     $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  209.   end
  210.   @now_text.gsub!(/\\\\\\\\/) { "\\000" }
  211.   @now_text.gsub!(/\\\\[Cc]\\[([0-9]+)\\]/) { "\\001[#{$1}]" }
  212.   @now_text.gsub!(/\\\\[Gg]/) { "\\002" }
  213.   @now_text.gsub!(/\\\\[Ss]\\[([0-9]+)\\]/) { "\\003[#{$1}]" }
  214.   @now_text.gsub!(/\\\\[Aa]\\[(.*?)\\]/) { "\\004[#{$1}]" }
  215.   @now_text.gsub!(/\\\\[.]/) { "\\005" }
  216.   @now_text.gsub!(/\\\\[|]/) { "\\006" }
  217.   @now_text.gsub!(/\\\\[>]/) { "\\016" }
  218.   @now_text.gsub!(/\\\\[<]/) { "\\017" }
  219.   @now_text.gsub!(/\\\\[!]/) { "\\020" }
  220.   @now_text.gsub!(/\\\\[~]/) { "\\021" }
  221.   
  222.   @now_text.gsub!(/\\\\[Ii]/) { "\\023" }
  223.   @now_text.gsub!(/\\\\[Oo]\\[([0-9]+)\\]/) { "\\024[#{$1}]" }
  224.   @now_text.gsub!(/\\\\[Hh]\\[([0-9]+)\\]/) { "\\025[#{$1}]" }
  225.   @now_text.gsub!(/\\\\[Bb]\\[([0-9]+)\\]/) { "\\026[#{$1}]" }
  226.   @now_text.gsub!(/\\\\[Kk]\\[(.*?)\\]/) { "\\027[#{$1}]" }
  227.   if @popchar >= 0
  228.     @text_save = @now_text.clone
  229.     @max_x = 0
  230.     @max_y = 4
  231.     for i in 0..3
  232.     line = @now_text.split(/\\n/)[3-i]
  233.     @max_y -= 1 if line == nil and @max_y <= 4-i
  234.     next if line == nil
  235.     cx = contents.text_size(line).width
  236.     @max_x = cx if cx > @max_x
  237.     end
  238.     self.width = @max_x + 48 + @face_indent
  239.     self.height = (@max_y - 1) * 32 + 64
  240.   else
  241.     @max_x = self.width - 32 - @face_indent
  242.   end
  243.   reset_window
  244.     if name_window_set
  245.     off_x = 0
  246.     off_y = -40
  247.     space = 2
  248.     x = self.x + off_x - space / 2
  249.     y = self.y + off_y - space / 2
  250.     w = self.contents.text_size(name_text).width + 26 + space
  251.     h = 40 + space
  252.     @name_window_frame = Window_Frame.new(x, y, w, h)
  253.     @name_window_frame.z = self.z + 1
  254.     x = self.x + off_x + 4
  255.     y = self.y + off_y
  256.     @name_window_text = Air_Text.new(x+4, y+6, name_text)
  257.     @name_window_text.z = self.z + 2
  258.     end
  259.   end
  260.   reset_window
  261.   if $game_temp.choice_max > 0
  262.     @item_max = $game_temp.choice_max
  263.     self.active = true
  264.     self.index = 0
  265.   end
  266.   if $game_temp.num_input_variable_id > 0
  267.     digits_max = $game_temp.num_input_digits_max
  268.     number = $game_variables[$game_temp.num_input_variable_id]
  269.     @input_number_window = Window_InputNumber.new(digits_max)
  270.     @input_number_window.number = number
  271.     @input_number_window.x = self.x + 8
  272.     @input_number_window.y = self.y + $game_temp.num_input_start * 32
  273.   end
  274. end
  275. #--------------------------------------------------------------------------
  276. # ● 更新
  277. #--------------------------------------------------------------------------
  278. def update
  279.   super
  280.   if @fade_in
  281.     self.contents_opacity += 24
  282.     if @input_number_window != nil
  283.     @input_number_window.contents_opacity += 24
  284.     end
  285.     if self.contents_opacity == 255
  286.     @fade_in = false
  287.     end
  288.     return
  289.   end
  290.   @now_text = nil if @now_text == ""
  291.   
  292.   if @now_text != nil and @mid_stop == false
  293.     if @write_wait > 0
  294.     @write_wait -= 1
  295.     return
  296.     end
  297.     text_not_skip = $game_system.typing
  298.     while true
  299.     @max_x = @x if @max_x < @x
  300.     @max_y = @y if @max_y < @y
  301.     if (c = @now_text.slice!(/./m)) != nil
  302.       if c == "\\000"
  303.         c = "\\\\"
  304.       end
  305.       if c == "\\001"
  306.         @now_text.sub!(/\\[([0-9]+)\\]/, "")
  307.         color = $1.to_i
  308.         if color >= 0 and color <= 7
  309.         self.contents.font.color = text_color(color)
  310.         end
  311.         c = ""
  312.       end
  313.       if c == "\\002"
  314.         if @gold_window == nil and @popchar <= 0
  315.         @gold_window = Window_Gold.new
  316.         @gold_window.x = 560 - @gold_window.width
  317.         if $game_temp.in_battle
  318.           @gold_window.y = 192
  319.         else
  320.           @gold_window.y = self.y >= 128 ? 32 : 384
  321.         end
  322.         @gold_window.opacity = self.opacity
  323.         @gold_window.back_opacity = self.back_opacity
  324.         end
  325.         c = ""
  326.       end
  327.       if c == "\\003"
  328.         @now_text.sub!(/\\[([0-9]+)\\]/, "")
  329.         speed = $1.to_i
  330.         if speed >= 0 and speed <= 19
  331.         @write_speed = speed
  332.         end
  333.         c = ""
  334.       end
  335.       if c == "\\004"
  336.         @now_text.sub!(/\\[(.*?)\\]/, "")
  337.         buftxt = $1.dup.to_s
  338.         if buftxt.match(/\\//) == nil and buftxt != "" then
  339.         $game_system.soundname_on_speak = "Audio/SE/" + buftxt
  340.         else
  341.         $game_system.soundname_on_speak = buftxt.dup
  342.         end
  343.         c = ""
  344.       elsif c == "\\004"
  345.         c = ""
  346.       end
  347.       if c == "\\005"
  348.         @write_wait += 5
  349.         c = ""
  350.       end
  351.       if c == "\\006"
  352.         @write_wait += 20
  353.         c = ""
  354.       end
  355.       if c == "\\016"
  356.         text_not_skip = false
  357.         c = ""
  358.       end
  359.       if c == "\\017"
  360.         text_not_skip = true
  361.         c = ""
  362.       end
  363.       if c == "\\020"
  364.         @mid_stop = true
  365.         c = ""
  366.       end
  367.       if c == "\\021"
  368.         terminate_message
  369.         return
  370.       end
  371.       if c == "\\023"
  372.         @indent = @x
  373.         c = ""
  374.       end
  375.       if c == "\\024"
  376.         @now_text.sub!(/\\[([0-9]+)\\]/, "")
  377.         @opacity = $1.to_i
  378.         c = ""
  379.       end
  380.       if c == "\\025"
  381.         @now_text.sub!(/\\[([0-9]+)\\]/, "")
  382.         self.contents.font.size = [[$1.to_i, 6].max, 32].min
  383.         c = ""
  384.       end
  385.       if c == "\\026"
  386.         @now_text.sub!(/\\[([0-9]+)\\]/, "")
  387.         @x += $1.to_i
  388.         c = ""
  389.       end
  390.       if c == "\\027"
  391.         @now_text.sub!(/\\[(.*?)\\]/, "")
  392.         @x += ruby_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), $1, @opacity)
  393.         if $game_system.soundname_on_speak != ""
  394.         Audio.se_play($game_system.soundname_on_speak)
  395.         end
  396.         c = ""
  397.       end
  398.       if c == "\\030"
  399.         @now_text.sub!(/\\[(.*?)\\]/, "")
  400.         self.contents.blt(@x , @y * line_height + 8, RPG::Cache.icon($1), Rect.new(0, 0, 24, 24))
  401.       if $game_system.soundname_on_speak != ""
  402.         Audio.se_play($game_system.soundname_on_speak)
  403.         end
  404.         @x += 24
  405.         c = ""
  406.       end
  407.       if c == "\\n"
  408.         if @lines >= $game_temp.choice_start
  409.         @cursor_width = [@cursor_width, @max_x - @face_indent].max
  410.         end
  411.         @lines += 1
  412.         @y += 1
  413.         @x = 0 + @indent + @face_indent
  414.         if @lines >= $game_temp.choice_start
  415.         @x = 8 + @indent + @face_indent
  416.         end
  417.         c = ""
  418.       end
  419.       if c != ""
  420.         # 文字描画
  421.         @x += opacity_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), c, @opacity)
  422.         if $game_system.soundname_on_speak != "" then
  423.         Audio.se_play($game_system.soundname_on_speak)
  424.         end
  425.       end
  426.       if Input.press?(Input::B)
  427.         text_not_skip = false
  428.       end
  429.     else
  430.       text_not_skip = true
  431.       break
  432.     end
  433.     # 終了判定
  434.     if text_not_skip
  435.       break
  436.     end
  437.     end
  438.     @write_wait += @write_speed
  439.     return
  440.   end
  441.   if @input_number_window != nil
  442.     @input_number_window.update
  443.     # 決定
  444.     if Input.trigger?(Input::C)
  445.     $game_system.se_play($data_system.decision_se)
  446.     $game_variables[$game_temp.num_input_variable_id] =
  447.     @input_number_window.number
  448.     $game_map.need_refresh = true
  449.     @input_number_window.dispose
  450.     @input_number_window = nil
  451.     terminate_message
  452.     end
  453.     return
  454.   end
  455.   if @contents_showing
  456.     if $game_temp.choice_max == 0
  457.     self.pause = true
  458.     end
  459.     # 取消
  460.     if Input.trigger?(Input::B)
  461.     if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  462.       $game_system.se_play($data_system.cancel_se)
  463.       $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  464.       $game_temp.need_show_more = false
  465.       terminate_message
  466.     end
  467.     end
  468.     # 決定
  469.     if Input.trigger?(Input::C)
  470.     if $game_temp.choice_max > 0
  471.       $game_system.se_play($data_system.decision_se)
  472.       $game_temp.choice_proc.call(self.index)
  473.     end
  474.     if @mid_stop
  475.       @mid_stop = false
  476.       return
  477.     else
  478.       $game_temp.need_show_more = false
  479.       terminate_message
  480.     end
  481.     end
  482.     return
  483.   end
  484.   if @fade_out == false and $game_temp.message_text != nil
  485.     @contents_showing = true
  486.     $game_temp.message_window_showing = true
  487.     refresh
  488.     Graphics.frame_reset
  489.     self.visible = true
  490.     self.contents_opacity = 0
  491.   if @input_number_window != nil
  492.     @input_number_window.contents_opacity = 0
  493.   end
  494.     @fade_in = true
  495.     return
  496.   end
  497.   if self.visible
  498.     @fade_out = true
  499.     self.opacity -= 48
  500.     if self.opacity == 0
  501.     self.visible = false
  502.     @fade_out = false
  503.     $game_temp.message_window_showing = false
  504.     end
  505.     return
  506.   end
  507. end
  508. #--------------------------------------------------------------------------
  509. # ● 获得字符
  510. #--------------------------------------------------------------------------
  511. def get_character(parameter)
  512.   case parameter
  513.   when 0
  514.     return $game_player
  515.   else
  516.     events = $game_map.events
  517.     return events == nil ? nil : events[parameter]
  518.   end
  519. end
  520. #--------------------------------------------------------------------------
  521. # ● ウィンドウの位置と不透明度の設定
  522. #--------------------------------------------------------------------------
  523. def reset_window
  524.   # 判定
  525.   if @popchar >= 0
  526.     events = $game_map.events
  527.     if events != nil
  528.     character = get_character(@popchar)
  529.     x = [[character.screen_x - 0 - self.width / 2, 4].max, 636 - self.width].min
  530.     y = [[character.screen_y - 48 - self.height, 4].max, 476 - self.height].min
  531.     self.x = x
  532.     self.y = y
  533.     end
  534.   elsif @popchar == -1
  535.     self.x = -4
  536.     self.y = -4
  537.     self.width = 648
  538.     self.height = 488
  539.   else
  540.     if $game_temp.in_battle
  541.     self.y = 16
  542.     else
  543.     case $game_system.message_position
  544.     when 0 # 上
  545.       self.y = 16
  546.     when 1 # 中
  547.       self.y = 160
  548.     when 2 # 下
  549.       self.y = 304
  550.     end
  551.     self.x = 80
  552.     if @face_file == nil
  553.       self.width = 480
  554.     else
  555.       self.width = 600
  556.       self.x -= 60
  557.     end
  558.     self.height = 160
  559.     end
  560.   end
  561.   self.contents = Bitmap.new(self.width - 32, self.height - 32)
  562.   if @face_file != nil
  563.     self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))
  564.   end
  565.   if @popchar == -1
  566.     self.opacity = 255
  567.     self.back_opacity = 0
  568.   elsif $game_system.message_frame == 0
  569.     self.opacity = 255
  570.     self.back_opacity = 200
  571.   else
  572.     self.opacity = 0
  573.     self.back_opacity = 200
  574.   end
  575. end
  576. #--------------------------------------------------------------------------
  577. # ● line_height
  578. #--------------------------------------------------------------------------
  579. # 返回値:行高
  580. #--------------------------------------------------------------------------
  581. def line_height
  582.   return 32
  583.   if self.contents.font.size >= 20 and self.contents.font.size <= 24
  584.     return 32
  585.   else
  586.     return self.contents.font.size * 15 / 10
  587.   end
  588. end
  589. #--------------------------------------------------------------------------
  590. # ● 透過文字描画
  591. #--------------------------------------------------------------------------
  592. # target :描画対象。Bitmapクラスを指定。
  593. # x :x座標
  594. # y :y座標
  595. # str  :描画文字列
  596. # opacity:透過率(0~255)
  597. # 返回値 :文字幅(@x増加値)。
  598. #--------------------------------------------------------------------------
  599. def opacity_draw_text(target, x, y, str,opacity)
  600.   height = target.font.size
  601.   width = target.text_size(str).width
  602.   opacity = [[opacity, 0].max, 255].min
  603.   if opacity == 255
  604.     target.draw_text(x, y, width, height, str)
  605.     return width
  606.   else
  607.     if @opacity_text_buf.width < width or @opacity_text_buf.height < height
  608.     @opacity_text_buf.dispose
  609.     @opacity_text_buf = Bitmap.new(width, height)
  610.     else
  611.     @opacity_text_buf.clear
  612.     end
  613.     @opacity_text_buf.font.size = target.font.size
  614.     @opacity_text_buf.draw_text(0, 0, width, height, str)
  615.     target.blt(x, y, @opacity_text_buf, Rect.new(0, 0, width, height), opacity)
  616.   return width
  617.   end
  618. end
  619. def ruby_draw_text(target, x, y, str,opacity)
  620.   sizeback = target.font.size
  621.   target.font.size * 3 / 2 > 32 ? rubysize = 32 - target.font.size : rubysize = target.font.size / 2
  622.   rubysize = [rubysize, 6].max
  623.   
  624.   opacity = [[opacity, 0].max, 255].min
  625.   split_s = str.split(/,/)
  626.   
  627.   split_s[0] == nil ? split_s[0] = "" : nil
  628.   split_s[1] == nil ? split_s[1] = "" : nil
  629.   
  630.   height = sizeback + rubysize
  631.   width = target.text_size(split_s[0]).width
  632.   
  633.   target.font.size = rubysize
  634.   ruby_width = target.text_size(split_s[1]).width
  635.   target.font.size = sizeback
  636.   
  637.   buf_width = [target.text_size(split_s[0]).width, ruby_width].max
  638.   
  639.   width - ruby_width != 0 ? sub_x = (width - ruby_width) / 2 : sub_x = 0
  640.   
  641.   if opacity == 255
  642.     target.font.size = rubysize
  643.     target.draw_text(x + sub_x, y - target.font.size, target.text_size(split_s[1]).width, target.font.size, split_s[1])
  644.     target.font.size = sizeback
  645.     target.draw_text(x, y, width, target.font.size, split_s[0])
  646.     return width
  647.   else
  648.     if @opacity_text_buf.width < buf_width or @opacity_text_buf.height < height
  649.     @opacity_text_buf.dispose
  650.     @opacity_text_buf = Bitmap.new(buf_width, height)
  651.     else
  652.     @opacity_text_buf.clear
  653.     end
  654.     @opacity_text_buf.font.size = rubysize
  655.     @opacity_text_buf.draw_text(0 , 0, buf_width, rubysize, split_s[1], 1)
  656.     @opacity_text_buf.font.size = sizeback
  657.     @opacity_text_buf.draw_text(0 , rubysize, buf_width, sizeback, split_s[0], 1)
  658.     if sub_x >= 0
  659.     target.blt(x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  660.     else
  661.     target.blt(x + sub_x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  662.     end
  663.     return width
  664.   end
  665. end
  666. #--------------------------------------------------------------------------
  667. # ● \\V 变换
  668. #--------------------------------------------------------------------------
  669. def convart_value(option, index)
  670.   option == nil ? option = "" : nil
  671.   option.downcase!
  672.   case option
  673.     when "i"
  674.     unless $data_items[index].name == nil
  675.       r = sprintf("\\030[%s]%s", $data_items[index].icon_name, $data_items[index].name)
  676.     end
  677.     when "w"
  678.     unless $data_weapons[index].name == nil
  679.       r = sprintf("\\030[%s]%s", $data_weapons[index].icon_name, $data_weapons[index].name)
  680.     end
  681.     when "a"
  682.     unless $data_armors[index].name == nil
  683.       r = sprintf("\\030[%s]%s", $data_armors[index].icon_name, $data_armors[index].name)
  684.     end
  685.     when "s"
  686.     unless $data_skills[index].name == nil
  687.       r = sprintf("\\030[%s]%s", $data_skills[index].icon_name, $data_skills[index].name)
  688.     end
  689.     else
  690.     r = $game_variables[index]
  691.   end
  692.   r == nil ? r = "" : nil
  693.   return r
  694. end
  695. #--------------------------------------------------------------------------
  696. # ● 解放
  697. #--------------------------------------------------------------------------
  698. def dispose
  699.   terminate_message
  700.   if @gaiji_cache != nil
  701.     unless @gaiji_cache.disposed?
  702.     @gaiji_cache.dispose
  703.     end
  704.   end
  705.   unless @opacity_text_buf.disposed?
  706.     @opacity_text_buf.dispose
  707.   end
  708.   $game_temp.message_window_showing = false
  709.   if @input_number_window != nil
  710.     @input_number_window.dispose
  711.   end
  712.   super
  713. end
  714. #--------------------------------------------------------------------------
  715. # ● 矩形更新
  716. #--------------------------------------------------------------------------
  717. def update_cursor_rect
  718.   if @index >= 0
  719.     n = $game_temp.choice_start + @index
  720.     self.cursor_rect.set(4 + @indent + @face_indent, n * 32 + 4, @cursor_width, 32)
  721.   else
  722.     self.cursor_rect.empty
  723.   end
  724. end
  725. end
  726. #==============================================================================
  727. # ■ Window_Frame (枠だけで中身の無いウィンドウ)
  728. #==============================================================================
  729. class Window_Frame < Window_Base
  730. #--------------------------------------------------------------------------
  731. # ● オブジェクト初期化
  732. #--------------------------------------------------------------------------
  733. def initialize(x, y, width, height)
  734.   super(x, y, width, height)
  735.   self.contents = nil
  736.   self.back_opacity = 200
  737. end
  738. #--------------------------------------------------------------------------
  739. # ● 解放
  740. #--------------------------------------------------------------------------
  741. def dispose
  742.   super
  743.   end
  744. end
  745. #==============================================================================
  746. # ■ Air_Text (何も無いところに文字描写 = 枠の無い瞬間表示メッセージウィンドウ)
  747. #==============================================================================
  748. class Air_Text < Window_Base
  749. #--------------------------------------------------------------------------
  750. # ● オブジェクト初期化
  751. #--------------------------------------------------------------------------
  752. def initialize(x, y, designate_text)
  753.   super(x-16, y-16, 32 + designate_text.size * 12, 56)
  754.   self.opacity = 0
  755.   self.back_opacity = 0
  756.   self.contents = Bitmap.new(self.width - 32, self.height - 32)
  757.   w = self.contents.width
  758.   h = self.contents.height
  759.   self.contents.draw_text(0, 0, w, h, designate_text)
  760. end
  761. #--------------------------------------------------------------------------
  762. # ● 解放
  763. #--------------------------------------------------------------------------
  764. def dispose
  765.   self.contents.clear
  766.   super
  767. end
  768. end
  769. class Interpreter
  770. def command_102
  771.   # 文章已经设置过 message_text 的情况下
  772.   if $game_temp.message_text != nil
  773.     # 结束
  774.     return false
  775.   end
  776.   # 设置信息结束后待机和返回调用标志
  777.   @message_waiting = true
  778.   $game_temp.message_proc = Proc.new { @message_waiting = false }
  779.   # 设置选择项
  780.   $game_temp.message_text = ""
  781.   $game_temp.choice_start = 0
  782.   if $game_temp.need_show_more
  783.     @parameters = [$game_temp.choices, $game_temp.choice_cancel_type]
  784.   end
  785.   setup_choices(@parameters)
  786.   # 继续
  787.   return true
  788. end
  789. end
复制代码
我突然发现,我是一个很幸运的好人。老婆真好~ 点我进入JQ(激情)教程范例收集!
回复 支持 反对

使用道具 举报

90

主题

785

帖子

1278万

积分

版主

Rank: 7Rank: 7Rank: 7

积分
12786515
QQ
 楼主| 发表于 2006-10-12 15:48:21 | 显示全部楼层
不行。。。。。 [s:5]
回复 支持 反对

使用道具 举报

38

主题

3468

帖子

1

积分

超级版主

传说中的Bunny火神~!

Rank: 8Rank: 8

积分
1
发表于 2006-10-12 19:09:36 | 显示全部楼层
那就只好舍弃其中一个了…… [s:5]
我突然发现,我是一个很幸运的好人。老婆真好~ 点我进入JQ(激情)教程范例收集!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-6-28 22:10 , Processed in 0.011753 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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