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

Project1

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

[原创发布] 【脚本】显示人物立绘

[复制链接]

Lv1.梦旅人

梦石
0
星屑
150
在线时间
332 小时
注册时间
2013-7-6
帖子
356
跳转到指定楼层
1
发表于 2015-2-15 17:47:40 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 wolves 于 2015-2-15 17:49 编辑

自己编的一套显示人物立绘的脚本,立绘是新建的viewport,附截图与范例。
截图:
样式1:
样式2:
范例: Project2.rar (752.21 KB, 下载次数: 416)
代码:
RUBY 代码复制
  1. #============================================================================
  2. =begin
  3.     编制人 wolves 发布位置 rpg.blue
  4.     显示人物立绘脚本,将下列脚本写在显示文章事件前即可显示立绘
  5.     $text_menu=[[name1(,left_fix1,top_fix1)],[name2(,left_fix2,top_fix2)],
  6.       [zoom_x,zoom_y](,type)]
  7.     其中括号部分可以省略
  8.     name1为 "" 则只显示右边的立绘,对话框左移;
  9.     name2为 "" 则只显示左边的立绘,对话框右移;
  10.     name1与name2均不为 "" 的情况下对话框居中剪短,两边一同显示立绘。
  11.     name1为 立绘1 的文件名(picture文件夹下)
  12.     如果觉得立绘位置不满意,可以通过left_fix1、top_fix1来修改图片位置。
  13.     比如想要只有左面的立绘 "1.png" ,并且根据原来的位置向上移动10像素,
  14. 向左移动12像素,不缩放:
  15.     $text_menu=[["1.png",-12,-10],[""],[100,100]]#然后后面紧跟显示文章
  16.     如果想要对图片进行缩放的话,可以修改zoom_x,zoom_y,立绘缩放是统一缩
  17. 放大小的,如果希望分别改大小的话,修改图片吧,或者参考359~365行内容
  18.     如果想要改变成没有左右边的形式的窗口,就把type设置成1吧(type可以缺省)
  19. =end
  20. #============================================================================
  21. class Game_Character_Picture
  22.   #--------------------------------------------------------------------------
  23.   # ● 定义实例变量
  24.   #--------------------------------------------------------------------------
  25.   attr_reader   :number                   # 图片编号
  26.   attr_reader   :name                     # 文件名
  27.   attr_reader   :origin                   # 原点
  28.   attr_reader   :x                        # X 坐标
  29.   attr_reader   :y                        # Y 坐标
  30.   attr_reader   :zoom_x                   # X 方向放大率
  31.   attr_reader   :zoom_y                   # Y 方向放大率
  32.   attr_reader   :opacity                  # 不透明度
  33.   attr_reader   :blend_type               # 合成方式
  34.   attr_reader   :tone                     # 色调
  35.   attr_reader   :angle                    # 旋转角度
  36.   #--------------------------------------------------------------------------
  37.   # ● 初始化对像
  38.   #     number : 图片编号
  39.   #--------------------------------------------------------------------------
  40.   def initialize(number)
  41.     @number = number
  42.     @name = ""
  43.     @origin = 0
  44.     @x = 0.0
  45.     @y = 0.0
  46.     @zoom_x = 100.0
  47.     @zoom_y = 100.0
  48.     @opacity = 255.0
  49.     @blend_type = 1
  50.     @duration = 0
  51.     @target_x = @x
  52.     @target_y = @y
  53.     @target_zoom_x = @zoom_x
  54.     @target_zoom_y = @zoom_y
  55.     @target_opacity = @opacity
  56.     @tone = Tone.new(0, 0, 0, 0)
  57.     @tone_target = Tone.new(0, 0, 0, 0)
  58.     @tone_duration = 0
  59.     @angle = 0
  60.     @rotate_speed = 0
  61.   end
  62.   #--------------------------------------------------------------------------
  63.   # ● 显示图片
  64.   #     name         : 文件名
  65.   #     origin       : 原点
  66.   #     x            : X 坐标
  67.   #     y            : Y 坐标
  68.   #     zoom_x       : X 方向放大率
  69.   #     zoom_y       : Y 方向放大率
  70.   #     opacity      : 不透明度
  71.   #     blend_type   : 合成方式
  72.   #--------------------------------------------------------------------------
  73.   def show(name, x, y, zoom_x, zoom_y, left_fix, top_fix)
  74.     @name = name
  75.     @origin = 0
  76.     left_fix = 0 if left_fix.nil?
  77.     top_fix = 0 if top_fix.nil?
  78.     @x = left_fix + x.to_f
  79.     @y = top_fix + y.to_f
  80.     @zoom_x = zoom_x.to_f
  81.     @zoom_y = zoom_y.to_f
  82.     @opacity = 255.0
  83.     @blend_type = 0
  84.     @duration = 0
  85.     @target_x = @x
  86.     @target_y = @y
  87.     @target_zoom_x = @zoom_x
  88.     @target_zoom_y = @zoom_y
  89.     @target_opacity = @opacity
  90.     @tone = Tone.new(0, 0, 0, 0)
  91.     @tone_target = Tone.new(0, 0, 0, 0)
  92.     @tone_duration = 0
  93.     @angle = 0
  94.     @rotate_speed = 0
  95.   end
  96.   #--------------------------------------------------------------------------
  97.   # ● 开始更改色调
  98.   #     tone     : 色调
  99.   #     duration : 时间
  100.   #--------------------------------------------------------------------------
  101.   def start_tone_change(tone, duration)
  102.     @tone_target = tone.clone
  103.     @tone_duration = duration
  104.     if @tone_duration == 0
  105.       @tone = @tone_target.clone
  106.     end
  107.   end
  108.   #--------------------------------------------------------------------------
  109.   # ● 消除图片
  110.   #--------------------------------------------------------------------------
  111.   def erase
  112.     @name = ""
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ● 刷新画面
  116.   #--------------------------------------------------------------------------
  117.   def update
  118.     if @duration >= 1
  119.       d = @duration
  120.       @x = (@x * (d - 1) + @target_x) / d
  121.       @y = (@y * (d - 1) + @target_y) / d
  122.       @zoom_x = (@zoom_x * (d - 1) + @target_zoom_x) / d
  123.       @zoom_y = (@zoom_y * (d - 1) + @target_zoom_y) / d
  124.       @opacity = (@opacity * (d - 1) + @target_opacity) / d
  125.       @duration -= 1
  126.     end
  127.     if @tone_duration >= 1
  128.       d = @tone_duration
  129.       @tone.red = (@tone.red * (d - 1) + @tone_target.red) / d
  130.       @tone.green = (@tone.green * (d - 1) + @tone_target.green) / d
  131.       @tone.blue = (@tone.blue * (d - 1) + @tone_target.blue) / d
  132.       @tone.gray = (@tone.gray * (d - 1) + @tone_target.gray) / d
  133.       @tone_duration -= 1
  134.     end
  135.     if @rotate_speed != 0
  136.       @angle += @rotate_speed / 2.0
  137.       while @angle < 0
  138.         @angle += 360
  139.       end
  140.       @angle %= 360
  141.     end
  142.   end
  143. end
  144. class Window_Message
  145.   def initialize
  146.     super(80, 304, 480, 160)
  147.     self.contents = Bitmap.new(width - 32, height - 32)
  148.     self.visible = false
  149.     self.z = 9997
  150.     @fade_in = false
  151.     @fade_out = false
  152.     @contents_showing = false
  153.     @cursor_width = 0
  154.     self.active = false
  155.     self.index = -1
  156.     @indexs = [self.x*2,self.width - self.x*2,self.x,self.width] if @indexs.nil?
  157.     @changes = false
  158.   end
  159.   def refresh
  160.     self.contents.clear
  161.     self.contents.font.color = normal_color
  162.     x = y = 0
  163.     @cursor_width = 0
  164.     # 到选择项的下一行字
  165.     if $game_temp.choice_start == 0
  166.       x = 8
  167.     end
  168.     # 有等待显示的文字的情况下
  169.     if $game_temp.message_text != nil
  170.       text = $game_temp.message_text
  171.       # 限制文字处理
  172.       begin
  173.         last_text = text.clone
  174.         text.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }
  175.       end until text == last_text
  176.       text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  177.         $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  178.       end
  179.       # 为了方便、将 "\\\\" 变换为 "\000"
  180.       text.gsub!(/\\\\/) { "\000" }
  181.       # "\\C" 变为 "\001" 将
  182.       text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  183.       # "\\G" 变为 "\002"
  184.       text.gsub!(/\\[Gg]/) { "\002" }
  185.       # c 获取 1 个字 (如果不能取得文字就循环)
  186.       while ((c = text.slice!(/./m)) != nil)
  187.         # \\ 的情况下
  188.         if c == "\000"
  189.           # 还原为本来的文字
  190.           c = "\\"
  191.         end
  192.         # \C[n] 的情况下
  193.         if c == "\001"
  194.           # 更改文字色
  195.           text.sub!(/\[([0-9]+)\]/, "")
  196.           color = $1.to_i
  197.           if color >= 0 and color <= 7
  198.             self.contents.font.color = text_color(color)
  199.           end
  200.           # 下面的文字
  201.           next
  202.         end
  203.         # \G 的情况下
  204.         if c == "\002"
  205.           # 生成金钱窗口
  206.           if @gold_window == nil
  207.             @gold_window = Window_Gold.new
  208.             @gold_window.x = 560 - @gold_window.width
  209.             if $game_temp.in_battle
  210.               @gold_window.y = 192
  211.             else
  212.               @gold_window.y = self.y >= 128 ? 32 : 384
  213.             end
  214.             @gold_window.opacity = self.opacity
  215.             @gold_window.back_opacity = self.back_opacity
  216.           end
  217.           # 下面的文字
  218.           next
  219.         end
  220.         # 另起一行文字的情况下
  221.         if c == "\n"
  222.           # 刷新选择项及光标的高
  223.           if y >= $game_temp.choice_start
  224.             @cursor_width = [@cursor_width, x].max
  225.           end
  226.           # y 加 1
  227.           y += 1
  228.           x = 0
  229.           # 移动到选择项的下一行
  230.           if y >= $game_temp.choice_start
  231.             x = 8
  232.           end
  233.           # 下面的文字
  234.           next
  235.         end
  236.         # 描绘文字
  237.         unless $text_menu.nil?
  238.           if $text_menu[3] == 1
  239.             unless $text_menu[0][0].empty?
  240.               self.contents.draw_text(200 + 4 + x, 32 * y, 40, 32, c)
  241.               # x 为要描绘文字的加法运算,文字右移200像素
  242.               x += self.contents.text_size(c).width
  243.             else
  244.               self.contents.draw_text(4 + x, 32 * y, 40, 32, c)
  245.               # x 为要描绘文字的加法运算
  246.               x += self.contents.text_size(c).width
  247.             end
  248.           else
  249.             self.contents.draw_text(4 + x, 32 * y, 40, 32, c)
  250.             # x 为要描绘文字的加法运算
  251.             x += self.contents.text_size(c).width
  252.           end
  253.         else
  254.           self.contents.draw_text(4 + x, 32 * y, 40, 32, c)
  255.           # x 为要描绘文字的加法运算
  256.           x += self.contents.text_size(c).width
  257.         end
  258.       end
  259.     end
  260.     # 选择项的情况
  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.     # 输入数值的情况
  267.     if $game_temp.num_input_variable_id > 0
  268.       digits_max = $game_temp.num_input_digits_max
  269.       number = $game_variables[$game_temp.num_input_variable_id]
  270.       @input_number_window = Window_InputNumber.new(digits_max)
  271.       @input_number_window.number = number
  272.       @input_number_window.x = self.x + 8
  273.       @input_number_window.y = self.y + $game_temp.num_input_start * 32
  274.     end
  275.   end
  276.   def reset_window
  277.     if $game_temp.in_battle
  278.       self.y = 16
  279.     else
  280.       case $game_system.message_position
  281.       when 0  # 上
  282.         self.y = 16
  283.       when 1  # 中
  284.         self.y = 160
  285.       when 2  # 下
  286.         self.y = 304
  287.       end
  288.     end
  289.     if $game_system.message_frame == 0
  290.       self.opacity = 255
  291.     else
  292.       self.opacity = 0
  293.     end
  294.     self.back_opacity = 160
  295.   end
  296.   def terminate_message
  297.     self.active = false
  298.     self.pause = false
  299.     self.index = -1
  300.     self.contents.clear
  301.     # 清除显示中标志
  302.     @contents_showing = false
  303.     # 呼叫信息调用
  304.     if $game_temp.message_proc != nil
  305.       $game_temp.message_proc.call
  306.     end
  307.     # 头像消失
  308.     $game_screen.tx_pictures[0].erase
  309.     $game_screen.tx_pictures[1].erase
  310.     $text_menu = nil
  311.     # 清除文章、选择项、输入数值的相关变量
  312.     $game_temp.message_text = nil
  313.     $game_temp.message_proc = nil
  314.     $game_temp.choice_start = 99
  315.     $game_temp.choice_max = 0
  316.     $game_temp.choice_cancel_type = 0
  317.     $game_temp.choice_proc = nil
  318.     $game_temp.num_input_start = 99
  319.     $game_temp.num_input_variable_id = 0
  320.     $game_temp.num_input_digits_max = 0
  321.     # 开放金钱窗口
  322.     if @gold_window != nil
  323.       @gold_window.dispose
  324.       @gold_window = nil
  325.     end
  326.   end
  327.   def update
  328.     super
  329.     # 渐变的情况下
  330.     if @fade_in
  331.       self.contents_opacity += 24
  332.       if @input_number_window != nil
  333.         @input_number_window.contents_opacity += 24
  334.       end
  335.       if self.contents_opacity == 255
  336.         @fade_in = false
  337.       end
  338.       return
  339.     end
  340.     # 输入数值的情况下
  341.     if @input_number_window != nil
  342.       @input_number_window.update
  343.       # 确定
  344.       if Input.trigger?(Input::C)
  345.         $game_system.se_play($data_system.decision_se)
  346.         $game_variables[$game_temp.num_input_variable_id] =
  347.           @input_number_window.number
  348.         $game_map.need_refresh = true
  349.         # 释放输入数值窗口
  350.         @input_number_window.dispose
  351.         @input_number_window = nil
  352.         $game_screen.tx = true
  353.       end
  354.       return
  355.     end
  356.     # 显示信息中的情况下
  357.     if @contents_showing
  358.       unless $text_menu.nil?
  359.         if $text_menu[3] == 1
  360.           $game_screen.tx_pictures[0].show($text_menu[0][0], 0, self.y-100, $text_menu[2][0], $text_menu[2][1],$text_menu[0][1],$text_menu[0][2])
  361.           $game_screen.tx_pictures[1].show($text_menu[1][0], 420, self.y-100, $text_menu[2][0], $text_menu[2][1],$text_menu[1][1],$text_menu[1][2])
  362.         else
  363.           $game_screen.tx_pictures[0].show($text_menu[0][0], self.x-150, self.y-100, $text_menu[2][0], $text_menu[2][1],$text_menu[0][1],$text_menu[0][2])
  364.           $game_screen.tx_pictures[1].show($text_menu[1][0], self.x+self.width-40, self.y-100, $text_menu[2][0], $text_menu[2][1],$text_menu[1][1],$text_menu[1][2])
  365.         end
  366.       end
  367.       # 如果不是在显示选择项中就显示暂停标志
  368.       if $game_temp.choice_max == 0
  369.         self.pause = true
  370.       end
  371.       # 取消
  372.       if Input.trigger?(Input::B)
  373.         if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  374.           $game_system.se_play($data_system.cancel_se)
  375.           $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  376.           terminate_message
  377.         end
  378.       end
  379.       # 确定
  380.       if Input.trigger?(Input::C)
  381.         if $game_temp.choice_max > 0
  382.           $game_system.se_play($data_system.decision_se)
  383.           $game_temp.choice_proc.call(self.index)
  384.         end
  385.         terminate_message
  386.       end
  387.       return
  388.     end
  389.     # 在渐变以外的状态下有等待显示的信息与选择项的场合
  390.     if @fade_out == false and $game_temp.message_text != nil
  391.       # 判断对话框位置
  392.       unless $text_menu.nil?
  393.         if $text_menu[3] == 1
  394.           self.x = -10
  395.           self.width = 660
  396.           self.contents = Bitmap.new(self.width - 32, self.height - 32)
  397.         else
  398.           if $text_menu[0][0].empty?
  399.             self.x = 0
  400.             self.width = @indexs[3]
  401.             self.contents = Bitmap.new(@indexs[3] - 32, self.height - 32)
  402.           elsif $text_menu[1][0].empty?
  403.             self.x = @indexs[0]
  404.             self.width = @indexs[3]
  405.             self.contents = Bitmap.new(@indexs[3] - 32, self.height - 32)
  406.           else
  407.             self.x=@indexs[0]
  408.             self.width = @indexs[1]
  409.             self.contents = Bitmap.new(self.width - 32, self.height - 32)
  410.           end
  411.         end
  412.       else
  413.         self.x = @indexs[2]
  414.         self.width = @indexs[3]
  415.         self.contents = Bitmap.new(@indexs[3] - 32, self.height - 32)
  416.       end
  417.       @contents_showing = true
  418.       $game_temp.message_window_showing = true
  419.       reset_window
  420.       refresh
  421.       Graphics.frame_reset
  422.       self.visible = true
  423.       self.contents_opacity = 0
  424.       if @input_number_window != nil
  425.         @input_number_window.contents_opacity = 0
  426.       end
  427.       @fade_in = true
  428.       return
  429.     end
  430.     # 没有可以显示的信息、但是窗口为可见的情况下
  431.     if self.visible
  432.       @fade_out = true
  433.       self.opacity -= 48
  434.       if self.opacity == 0
  435.         self.visible = false
  436.         @fade_out = false
  437.         $game_temp.message_window_showing = false
  438.       end
  439.       return
  440.     end
  441.   end
  442. end
  443. class Game_Screen
  444.   attr_accessor :tx_pictures
  445.   def initialize
  446.     @tone = Tone.new(0, 0, 0, 0)
  447.     @tone_target = Tone.new(0, 0, 0, 0)
  448.     @tone_duration = 0
  449.     @flash_color = Color.new(0, 0, 0, 0)
  450.     @flash_duration = 0
  451.     @shake_power = 0
  452.     @shake_speed = 0
  453.     @shake_duration = 0
  454.     @shake_direction = 1
  455.     @shake = 0
  456.     @pictures = [nil]
  457.     @tx_pictures=[]
  458.     for i in 1..100
  459.       @pictures.push(Game_Picture.new(i))
  460.     end
  461.     for i in 0..1
  462.       @tx_pictures.push(Game_Character_Picture.new(i))
  463.     end
  464.     @weather_type = 0
  465.     @weather_max = 0.0
  466.     @weather_type_target = 0
  467.     @weather_max_target = 0.0
  468.     @weather_duration = 0
  469.   end
  470.   def update
  471.     if @tone_duration >= 1
  472.       d = @tone_duration
  473.       @tone.red = (@tone.red * (d - 1) + @tone_target.red) / d
  474.       @tone.green = (@tone.green * (d - 1) + @tone_target.green) / d
  475.       @tone.blue = (@tone.blue * (d - 1) + @tone_target.blue) / d
  476.       @tone.gray = (@tone.gray * (d - 1) + @tone_target.gray) / d
  477.       @tone_duration -= 1
  478.     end
  479.     if @flash_duration >= 1
  480.       d = @flash_duration
  481.       @flash_color.alpha = @flash_color.alpha * (d - 1) / d
  482.       @flash_duration -= 1
  483.     end
  484.     if @shake_duration >= 1 or @shake != 0
  485.       delta = (@shake_power * @shake_speed * @shake_direction) / 10.0
  486.       if @shake_duration <= 1 and @shake * (@shake + delta) < 0
  487.         @shake = 0
  488.       else
  489.         @shake += delta
  490.       end
  491.       if @shake > @shake_power * 2
  492.         @shake_direction = -1
  493.       end
  494.       if @shake < - @shake_power * 2
  495.         @shake_direction = 1
  496.       end
  497.       if @shake_duration >= 1
  498.         @shake_duration -= 1
  499.       end
  500.     end
  501.     if @weather_duration >= 1
  502.       d = @weather_duration
  503.       @weather_max = (@weather_max * (d - 1) + @weather_max_target) / d
  504.       @weather_duration -= 1
  505.       if @weather_duration == 0
  506.         @weather_type = @weather_type_target
  507.       end
  508.     end
  509.     if $game_temp.in_battle
  510.       for i in 51..100
  511.         @pictures[i].update
  512.       end
  513.     else
  514.       for i in 1..50
  515.         @pictures[i].update
  516.       end
  517.     end
  518.     for i in 0..1
  519.       @tx_pictures[i].update
  520.     end
  521.   end
  522. end
  523. #==============================================================================
  524. # ■ Spriteset_Map
  525. #------------------------------------------------------------------------------
  526. #  处理地图画面活动块和元件的类。本类在
  527. # Scene_Map 类的内部使用。
  528. #==============================================================================
  529.  
  530. class Spriteset_Map
  531.   #--------------------------------------------------------------------------
  532.   # ● 初始化对像
  533.   #--------------------------------------------------------------------------
  534.   def initialize
  535.     # 生成显示端口
  536.     @viewport1 = Viewport.new(0, 0, 640, 480)
  537.     @viewport2 = Viewport.new(0, 0, 640, 480)
  538.     @viewport3 = Viewport.new(0, 0, 640, 480)
  539.     @viewport4 = Viewport.new(0, 0, 640, 480)
  540.     @viewport2.z = 200
  541.     @viewport3.z = 5000
  542.     @viewport4.z = 9998
  543.     # 生成元件地图
  544.     @tilemap = Tilemap.new(@viewport1)
  545.     @tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
  546.     for i in 0..6
  547.       autotile_name = $game_map.autotile_names[i]
  548.       @tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
  549.     end
  550.     @tilemap.map_data = $game_map.data
  551.     @tilemap.priorities = $game_map.priorities
  552.     # 生成远景平面
  553.     @panorama = Plane.new(@viewport1)
  554.     @panorama.z = -1000
  555.     # 生成覆盖远景平面
  556. #    if DKRM::FUNC_TWOMAP
  557. #      @panoramaz = Plane.new(@viewport1)
  558. #      @panoramaz.z = 2999
  559. #    end
  560.     # 生成雾平面
  561.     @fog = Plane.new(@viewport1)
  562.     @fog.z = 3000
  563.     # 生成角色活动块
  564.     @character_sprites = []
  565.     for i in $game_map.events.keys.sort
  566.       sprite = Sprite_Character.new(@viewport1, $game_map.events[i])
  567.       @character_sprites.push(sprite)
  568.     end
  569.     @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
  570.     # 生成天气
  571.     @weather = RPG::Weather.new(@viewport1)
  572.     # 生成图片
  573.     @picture_sprites = []
  574.     for i in 1..50
  575.       @picture_sprites.push(Sprite_Picture.new(@viewport2,
  576.         $game_screen.pictures[i]))
  577.     end
  578.     @tx_picture_sprites = []
  579.     for i in 0..1
  580.       @tx_picture_sprites.push(Sprite_Picture.new(@viewport4,
  581.       $game_screen.tx_pictures[i]))
  582.     end
  583.     # 生成计时器块
  584.     @timer_sprite = Sprite_Timer.new
  585.     # 刷新画面
  586.     update
  587.   end
  588.   #--------------------------------------------------------------------------
  589.   # ● 释放
  590.   #--------------------------------------------------------------------------
  591.   def dispose
  592.     # 释放元件地图
  593.     @tilemap.tileset.dispose
  594.     for i in 0..6
  595.       @tilemap.autotiles[i].dispose
  596.     end
  597.     @tilemap.dispose
  598.     # 释放远景平面
  599.     @panorama.dispose
  600.     # 释放覆盖远景平面
  601. #    if DKRM::FUNC_TWOMAP
  602. #      @panoramaz.dispose
  603. #    end
  604.     # 释放雾平面
  605.     @fog.dispose
  606.     # 释放角色活动块
  607.     for sprite in @character_sprites
  608.       sprite.dispose
  609.     end
  610.     # 释放天候
  611.     @weather.dispose
  612.     # 释放图片
  613.     for sprite in @picture_sprites
  614.       sprite.dispose
  615.     end
  616.     for sprite in @tx_picture_sprites
  617.       sprite.dispose
  618.     end
  619.     # 释放计时器块
  620.     @timer_sprite.dispose
  621.     # 释放显示端口
  622.     @viewport1.dispose
  623.     @viewport2.dispose
  624.     @viewport3.dispose
  625.     @viewport4.dispose
  626.   end
  627.   #--------------------------------------------------------------------------
  628.   # ● 刷新画面
  629.   #--------------------------------------------------------------------------
  630.   def update
  631.     # 远景与现在的情况有差异发情况下
  632.     if @panorama_name != $game_map.panorama_name or
  633.        @panorama_hue != $game_map.panorama_hue
  634.       @panorama_name = $game_map.panorama_name
  635.       @panorama_hue = $game_map.panorama_hue
  636.       if @panorama.bitmap != nil
  637.         @panorama.bitmap.dispose
  638.         @panorama.bitmap = nil
  639.       end
  640.       if @panorama_name != ""
  641.         @panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)
  642. #        if DKRM::FUNC_TWOMAP and\
  643. #          FileTest.exist?("Graphics/Panoramas/" + @panorama_name + "_2.png")
  644. #          @panoramaz.bitmap = RPG::Cache.panorama(@panorama_name + "_2"\
  645. #          ,@panorama_hue)
  646. #        end
  647.       end
  648.       Graphics.frame_reset
  649.     end
  650.     # 雾与现在的情况有差异的情况下
  651.     if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue
  652.       @fog_name = $game_map.fog_name
  653.       @fog_hue = $game_map.fog_hue
  654.       if @fog.bitmap != nil
  655.         @fog.bitmap.dispose
  656.         @fog.bitmap = nil
  657.       end
  658.       if @fog_name != ""
  659.         @fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)
  660.       end
  661.       Graphics.frame_reset
  662.     end
  663.     # 刷新元件地图
  664.     @tilemap.ox = $game_map.display_x / 4
  665.     @tilemap.oy = $game_map.display_y / 4
  666.     @tilemap.update
  667.     # 刷新远景与覆盖远景平面
  668.     m = 8
  669. #    if DKRM::FUNC_TWOMAP
  670. #      m = 4
  671. #      @panoramaz.ox = $game_map.display_x / 4
  672. #      @panoramaz.oy = $game_map.display_y / 4
  673. #    end
  674.     @panorama.ox = $game_map.display_x / m
  675.     @panorama.oy = $game_map.display_y / m
  676.     # 刷新雾平面
  677.     @fog.zoom_x = $game_map.fog_zoom / 100.0
  678.     @fog.zoom_y = $game_map.fog_zoom / 100.0
  679.     @fog.opacity = $game_map.fog_opacity
  680.     @fog.blend_type = $game_map.fog_blend_type
  681.     @fog.ox = $game_map.display_x / 4 + $game_map.fog_ox
  682.     @fog.oy = $game_map.display_y / 4 + $game_map.fog_oy
  683.     @fog.tone = $game_map.fog_tone
  684.     # 刷新角色活动块
  685.     for sprite in @character_sprites
  686.       sprite.update
  687.     end
  688.     # 刷新天候图形
  689.     @weather.type = $game_screen.weather_type
  690.     @weather.max = $game_screen.weather_max
  691.     @weather.ox = $game_map.display_x / 4
  692.     @weather.oy = $game_map.display_y / 4
  693.     @weather.update
  694.     # 刷新图片
  695.     for sprite in @picture_sprites
  696.       sprite.update
  697.     end
  698.     for sprite in @tx_picture_sprites
  699.       sprite.update
  700.     end
  701.     # 刷新计时器块
  702.     @timer_sprite.update
  703.     # 设置画面的色调与震动位置
  704.     @viewport1.tone = $game_screen.tone
  705.     @viewport1.ox = $game_screen.shake
  706.     # 设置画面的闪烁色
  707.     @viewport3.color = $game_screen.flash_color
  708.     # 刷新显示端口
  709.     @viewport1.update
  710.     @viewport3.update
  711.     @viewport4.update
  712.   end
  713. end

评分

参与人数 2+2 收起 理由
七夜弦 + 1
宇治松千夜 + 1 Best shoot!

查看全部评分

偶是熬夜学编程的傻子

Lv3.寻梦者

梦石
0
星屑
962
在线时间
134 小时
注册时间
2017-10-18
帖子
51
2
发表于 2017-10-19 10:53:24 | 只看该作者
太感谢了!!!新人用事件来改变立绘实在是太辛苦了。
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
962
在线时间
134 小时
注册时间
2017-10-18
帖子
51
3
发表于 2017-10-19 10:55:23 | 只看该作者
但是在切换文章的时候图片会不停的闪烁,有办法解决吗?
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (版主)

梦石
1
星屑
23963
在线时间
3338 小时
注册时间
2011-7-8
帖子
3925

开拓者

4
发表于 2017-10-19 12:05:49 手机端发表。 | 只看该作者
b1db1db1 发表于 2017-10-19 10:55
但是在切换文章的时候图片会不停的闪烁,有办法解决吗?

要不考虑用别的对话加强?比如图书馆里的rb重制版或者fuki
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
962
在线时间
134 小时
注册时间
2017-10-18
帖子
51
5
发表于 2017-10-19 15:07:25 | 只看该作者
guoxiaomi 发表于 2017-10-19 12:05
要不考虑用别的对话加强?比如图书馆里的rb重制版或者fuki

推荐的两个好像都不是我想要的效果,我想弄个与楼主一样的半身立绘互动系统,请问还有其他脚本吗?

点评

大概是什么效果呢?  发表于 2017-10-19 15:27
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
962
在线时间
134 小时
注册时间
2017-10-18
帖子
51
6
发表于 2017-10-19 15:46:06 | 只看该作者
guoxiaomi 发表于 2017-10-19 12:05
要不考虑用别的对话加强?比如图书馆里的rb重制版或者fuki

发不了图呢,有其他联系方式吗?
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
33193
在线时间
10491 小时
注册时间
2009-3-15
帖子
4756
7
发表于 2017-10-19 15:59:41 | 只看该作者
b1db1db1 发表于 2017-10-19 15:46
发不了图呢,有其他联系方式吗?

发图要点高级模式...
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
962
在线时间
134 小时
注册时间
2017-10-18
帖子
51
8
发表于 2017-10-19 16:04:53 | 只看该作者
soulsaga 发表于 2017-10-19 15:59
发图要点高级模式...

Server (I0) Error......服务器错误
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
33193
在线时间
10491 小时
注册时间
2009-3-15
帖子
4756
9
发表于 2017-10-19 16:08:11 | 只看该作者
本帖最后由 soulsaga 于 2017-10-19 17:04 编辑

我试了下.可以发图啊..

30690158_p0.png (5.45 KB, 下载次数: 20)

30690158_p0.png

点评

风太大..听不见666  发表于 2017-10-19 17:04
突然开车  发表于 2017-10-19 16:56
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-29 19:26

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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