查看: 2549|回复: 5

[已经解决] 有關某ATB 系統的Z值問題

[复制链接]
梦石
0
星屑
275
在线时间
54 小时
注册时间
2012-12-28
回帖
19
发表于 2013-9-9 21:56:26 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 wai781300 于 2013-9-10 09:46 编辑

近來使用了一個ATB系統腳本
ATB系統腳本傳送門

得出了如下效果
rm95.PNG

見到敵人的AP顯示條蓋上了
MOG_Hunter的立繪顯示腳本上

我去修改過mog_hunter裡立繪腳本的z值,可是不論改多高, ap條還是蓋過了立繪

求解答方法...爬過文也不懂如何自己修改...求賜教
以下是AP描畫的腳本(由於整個ATB系統涉及的腳本數太多,全部貼上會很可怕,所以揀取兩個看上去最大關連的)

  1. #==============================================================================
  2. # ■ Sprite_Battler
  3. #==============================================================================
  4. class Sprite_Battler < Sprite_Base
  5.   #--------------------------------------------------------------------------
  6.   # ● オブジェクト初期化
  7.   #--------------------------------------------------------------------------
  8.   alias :atb_initialize :initialize
  9.   def initialize(viewport, battler = nil)
  10.     atb_initialize(viewport, battler)
  11.     @gauge_sprite = Spriteset_Enemy_Gauge.new(battler, viewport) if
  12.                                           battler and battler.enemy?
  13.   end
  14.   #--------------------------------------------------------------------------
  15.   # ● 解放
  16.   #--------------------------------------------------------------------------
  17.   alias :atb_dispose :dispose
  18.   def dispose
  19.     @gauge_sprite.dispose if @gauge_sprite
  20.     atb_dispose
  21.   end
  22.   #--------------------------------------------------------------------------
  23.   # ● 位置の更新
  24.   #--------------------------------------------------------------------------
  25.   alias :atb_update_position :update_position
  26.   def update_position
  27.     atb_update_position
  28.     @gauge_sprite.update_rect(self.x, self.y, self.z) if @gauge_sprite
  29.   end
  30. end

  31. #==============================================================================
  32. # ■ Spriteset_Enemy_Gauge
  33. #==============================================================================
  34. class Spriteset_Enemy_Gauge
  35.   def initialize(battler, viewport)
  36.     @sprites = Array.new(4) {|i| Sprite_Enemy_Gauge.new(battler, viewport, i)}
  37.   end
  38.   def refresh_status
  39.     @sprites.each {|sprite| sprite.refresh}
  40.   end
  41.   def refresh_ap
  42.     @sprites[3].refresh
  43.   end
  44.   def dispose
  45.     @sprites.each {|sprite| sprite.dispose}
  46.   end
  47.   def update_rect(x, y, z)
  48.     @sprites.each {|sprite| sprite.update_rect(x, y, z)}
  49.   end
  50. end

  51. #==============================================================================
  52. # ■ Sprite_Enemy_Gauge
  53. #==============================================================================
  54. class Sprite_Enemy_Gauge < Sprite_Base
  55.   #--------------------------------------------------------------------------
  56.   # ● オブジェクト初期化
  57.   #--------------------------------------------------------------------------
  58.   def initialize(battler, viewport, gauge_number = nil)
  59.     super(Viewport.new(0, 0, Graphics.width, Graphics.height))
  60.     self.viewport.z = 0
  61.     self.bitmap = Bitmap.new(Graphics.width, Graphics.height)
  62.     @gauge_number = gauge_number
  63.     [url=home.php?mod=space&uid=133701]@battler[/url] = battler
  64.     if battler.is_a?(Game_Enemy)
  65.       @gauge_width = battler.gauge_width(@gauge_number)
  66.       @gauge_high = battler.gauge_high
  67.     else
  68.       @gauge_width = 100
  69.       @gauge_high = 0
  70.     end
  71.   end
  72.   #--------------------------------------------------------------------------
  73.   # ● APゲージ表示位置を更新
  74.   #--------------------------------------------------------------------------
  75.   def update_rect(x, y, z)
  76.     self.viewport.rect.x = x - @gauge_width / 2
  77.     self.viewport.rect.y = y - @gauge_high
  78.     self.viewport.rect.y += ATB::ENEMY_GAUGE_POS_DATA[@gauge_number]
  79.   end
  80.   #--------------------------------------------------------------------------
  81.   # ● APゲージ消去
  82.   #--------------------------------------------------------------------------
  83.   def clear
  84.     self.bitmap.clear
  85.   end
  86.   #--------------------------------------------------------------------------
  87.   # ● ゲージの描画
  88.   #--------------------------------------------------------------------------
  89.   def refresh
  90.     if @battler.draw_gauge?(@gauge_number)
  91.       draw_gauge
  92.     else
  93.       clear
  94.     end
  95.   end
  96.   #--------------------------------------------------------------------------
  97.   # ● APゲージの描画
  98.   #--------------------------------------------------------------------------
  99.   def draw_gauge
  100.     data = gauge_data
  101.     rate = data[0]
  102.     color = data[1]
  103.     rate = 0.0 if rate < 0.0 or rate.nan?
  104.     rate = 1.0 if rate > 1.0
  105.     fill_w = (@gauge_width * rate).to_i
  106.     color[0].alpha = ATB::ENEMY_AP_GAUGE_ALPHA
  107.     color[1].alpha = ATB::ENEMY_AP_GAUGE_ALPHA
  108.     self.bitmap.fill_rect(0, 0, @gauge_width, 6, color[0])
  109.     self.bitmap.gradient_fill_rect(0, 0, fill_w, 6,color[1], color[2])
  110.   end
  111.   #--------------------------------------------------------------------------
  112.   # ● ゲージの内容
  113.   #--------------------------------------------------------------------------
  114.   def gauge_data
  115.     case @gauge_number
  116.     when 0; rate = @battler.hp / @battler.mhp.to_f
  117.     when 1; rate = @battler.mp / @battler.mmp.to_f
  118.     when 2; rate = @battler.tp / @battler.max_tp.to_f
  119.     when 3; return [@battler.ap_rate, @battler.ap_gauge_color]
  120.     end
  121.     return [rate, ATB::ENEMY_GAUGE_COLOR_DATA[@gauge_number]]
  122.   end
  123. end

  124. #==============================================================================
  125. # ■ Game_Enemy
  126. #==============================================================================
  127. class Game_Enemy < Game_Battler
  128.   #--------------------------------------------------------------------------
  129.   # ● ゲージを描画するか
  130.   #--------------------------------------------------------------------------
  131.   def draw_gauge?(gauge_number)
  132.     return false if not alive?
  133.     return false if $game_switches[ATB::ENEMY_AP_GAUGE_HIDE_SWITCH] == true
  134.     return false if ATB::ENEMY_AP_GAUGE_HIDE_IN_TURN and BattleManager.in_turn?
  135.     return false if $game_temp.ap_gauge_hide_by_anime != []
  136.     feature_objects.each do |obj|
  137.       return !ATB::ENEMY_GAUGE_DRAW_DATA[gauge_number] if obj.no_draw_gauge(gauge_number)
  138.     end
  139.     return ATB::ENEMY_GAUGE_DRAW_DATA[gauge_number]
  140.   end
  141.   #--------------------------------------------------------------------------
  142.   # ● ゲージの長さ
  143.   #--------------------------------------------------------------------------
  144.   def gauge_width(gauge_number)
  145.     case gauge_number
  146.     when 0; return $1.to_i if enemy.note =~ /<HPゲージ長さ=(\d+)>/
  147.     when 1; return $1.to_i if enemy.note =~ /<MPゲージ長さ=(\d+)>/
  148.     when 2; return $1.to_i if enemy.note =~ /<TPゲージ長さ=(\d+)>/
  149.     when 3; return $1.to_i if enemy.note =~ /<APゲージ長さ=(\d+)>/
  150.     end
  151.     return ATB::ENEMY_GAUGE_WIDTH_DATA[gauge_number]
  152.   end
  153.   #--------------------------------------------------------------------------
  154.   # ● ゲージのy座標(縦の位置)
  155.   #--------------------------------------------------------------------------
  156.   def gauge_high
  157.     return enemy.note =~ /<ゲージ高さ=(\-*\d+)>/ ? $1.to_i : 0
  158.   end
  159. end

  160. class RPG::BaseItem
  161.   def no_draw_gauge(gauge_number)
  162.     unless @no_draw_gauge
  163.       @no_draw_gauge = []
  164.       for i in 0..3
  165.         case i
  166.         when 0; match = /<HPゲージ表示>/
  167.         when 1; match = /<MPゲージ表示>/
  168.         when 2; match = /<TPゲージ表示>/
  169.         when 3; match = /<APゲージ表示>/
  170.         end
  171.         @no_draw_gauge[i] = @note =~ match ? true : false
  172.       end
  173.     end
  174.     return @no_draw_gauge[gauge_number]
  175.   end
  176. end
复制代码


以下是設定


  1. module ATB
  2.   #--------------------------------------------------------------------------
  3.   # ● 設定項目
  4.   #--------------------------------------------------------------------------  
  5.   
  6.   #軽量化設定
  7.   #AP増加処理を頻繁に行うと動作環境によっては処理落ちする
  8.   #REFRESH_FRAMEの値を大きくすると、AP増加処理の間隔を長くして処理を軽くする
  9.   
  10.   #AP増加処理の間隔 3にすると3フレームに一回処理を行う
  11.   REFRESH_FRAME = 3
  12.   
  13.   
  14.   #味方AP情報に"AP"の文字を表示するか
  15.   AP_GAUGE_NAME = true
  16.   AP_GAUGE_NAME_TEXT_COLOR = Color.new(132, 170, 255)   #文字色
  17.   
  18.   #味方AP情報にAPの溜まり具合(パーセンテージ)を表示するか
  19.   AP_GAUGE_PERCENT = true
  20.   #AP_GAUGE_PERCENTをtrueにした場合のみ APの溜まり具合に"%"を付けるかどうか
  21.   AP_GAUGE_SIGN = true
  22.   AP_GAUGE_MAIN_TEXT_COLOR = Color.new(255, 255, 255)  #文字色
  23.   
  24.   
  25.   
  26.   #敵ゲージの不透明度 255で完全に不透明 0で透明
  27.   ENEMY_AP_GAUGE_ALPHA = 128
  28.   
  29.   #敵ゲージの設定 [HP, MP, TP, AP] の順番
  30.   ENEMY_GAUGE_DRAW_DATA  = [false, false, false, true]  # 表示するかどうか
  31.   ENEMY_GAUGE_POS_DATA   = [-18, -2, 8, -10]            # y座標(縦の位置)補正値
  32.   ENEMY_GAUGE_WIDTH_DATA = [100, 100, 80, 100]          # 長さデフォルト値
  33.   
  34.   #敵HP、MP、TPゲージの色 [背景,左側,右側]
  35.   ENEMY_HP_GAUGE_COLOR = [Color.new( 32,  32,  64),   # text_color(19)と同じ
  36.                           Color.new(224, 128,  64),   # text_color(20)
  37.                           Color.new(240, 192,  64)]   # text_color(21)
  38.   ENEMY_MP_GAUGE_COLOR = [Color.new( 32,  32,  64),   # text_color(19)
  39.                           Color.new( 64, 128, 192),   # text_color(22)
  40.                           Color.new( 64, 192, 240)]   # text_color(23)
  41.   ENEMY_TP_GAUGE_COLOR = [Color.new( 32,  32,  64),   # text_color(19)
  42.                           Color.new(  0, 160,  64),   # text_color(28)
  43.                           Color.new(  0, 224,  96)]   # text_color(29)
  44.   
  45.   #敵ゲージ非表示設定
  46.   ENEMY_AP_GAUGE_HIDE_SWITCH = 91      #スイッチがオンになっている間
  47.   ENEMY_AP_GAUGE_HIDE_IN_TURN = true #ターン中
  48.   ENEMY_AP_GAUGE_HIDE_ANIMATION =     #アニメーション表示中
  49.   [7, 13] # 7:斬撃/物理 13:刺突/物理
  50.   
  51. end
复制代码


MOG_HUNTER的立繪腳本

  1. #==============================================================================
  2. # +++ MOG - ACTOR PICTURE CM  (v1.2) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # [url]http://www.atelier-rgss.com/[/url]
  6. #==============================================================================
  7. # Apresenta a imagem do personagem durante a seleção de comandos, com efeitos
  8. # animados.
  9. #==============================================================================
  10. # ● Definindo o nome das imagens dos battlers.
  11. #==============================================================================
  12. # 1 - As imagens devem ser gravadas na pasta
  13. #
  14. # GRAPHICS/PICTURES
  15. #
  16. # 2 - Nomeie os  arquivos de imagens da seguinte forma.
  17. #
  18. #
  19. # ACTOR + ID
  20. #
  21. # EG
  22. #
  23. # ACTOR1.png
  24. #
  25. #==============================================================================

  26. #==============================================================================
  27. # ● Histórico (Version History)
  28. #==============================================================================
  29. # v 1.2 - Ajuste automático da imagem do battler.
  30. # v 1.1 - Correção do bug de não apagar a imagem quando o battler usa
  31. #         ações de que acertam todos os alvos.
  32. #==============================================================================

  33. module MOG_ACTOR_PICTURE_CM
  34.   #Posição da imagem do battler. (Para fazer ajustes)
  35.   PICTURE_POSITION = [45, -10]  
  36.   
  37.   #Definição da opacidade da imagem.
  38.   PICTURE_OPACITY = 255
  39.   
  40.   #Velocidade de deslize
  41.   SLIDE_SPEED = 30  
  42.   
  43.   #Ativar o efeito da imagem respirando.
  44.   BREATH_EFFECT = true
  45.   
  46.   #Definição da prioridade  da imagem na tela.
  47.   PICTURE_PRIORITY_Z = 100
  48. end

  49. #===============================================================================
  50. # ■ Sprite_Battler_CM
  51. #===============================================================================
  52. class Sprite_Battler_CM < Sprite
  53.   include MOG_ACTOR_PICTURE_CM
  54.   
  55.   #--------------------------------------------------------------------------
  56.   # ● Initialize
  57.   #--------------------------------------------------------------------------  
  58.   def initialize(viewport = nil,battler_id = -1)
  59.       super(viewport)
  60.       filename = "Actor" + battler_id.to_s
  61.       self.bitmap = Cache.picture(filename) rescue nil
  62.       self.bitmap = Cache.picture("") if self.bitmap == nil
  63.       sc = (544 / 2)  - (self.bitmap.width / 2) + PICTURE_POSITION[0]
  64.       @size = [self.bitmap.width + PICTURE_POSITION[0] ,sc]      
  65.       self.visible = false
  66.       self.opacity = 0
  67.       self.z = PICTURE_PRIORITY_Z
  68.       self.ox = 0
  69.       self.oy = self.bitmap.height
  70.       self.x = -@size[0]
  71.       self.y = (Graphics.height + 10) + PICTURE_POSITION[1]      
  72.       @breach_effect = [1.0,0]
  73.       @battler_id = battler_id
  74.       @active =  false
  75.       @cm_visible = false
  76.   end  
  77.   
  78.   #--------------------------------------------------------------------------
  79.   # ● Dispose
  80.   #--------------------------------------------------------------------------  
  81.   def dispose
  82.       super
  83.       self.bitmap.dispose
  84.   end
  85.   
  86.   #--------------------------------------------------------------------------
  87.   # ● Update
  88.   #--------------------------------------------------------------------------  
  89.   def update
  90.       super
  91.       update_slide
  92.   end  
  93.   
  94.   #--------------------------------------------------------------------------
  95.   # ● Active Battler
  96.   #--------------------------------------------------------------------------      
  97.   def active_battler(battler_id)
  98.       @active = @battler_id == battler_id ? true : false
  99.       self.visible = true if @active
  100.       @cm_visible = false if !@active
  101.   end
  102.   
  103.   #--------------------------------------------------------------------------
  104.   # ● Refresh Battler CM
  105.   #--------------------------------------------------------------------------        
  106.   def refresh_battler(cm_visible, battler_index)
  107.       @cm_visible = cm_visible
  108.       active_battler(battler_index)
  109.   end  
  110.   
  111.   #--------------------------------------------------------------------------
  112.   # ● Update Slide
  113.   #--------------------------------------------------------------------------  
  114.   def update_slide
  115.       if !@cm_visible
  116.            self.x -= SLIDE_SPEED if self.x > -@size[0]
  117.            self.opacity -= 25
  118.            if self.x <= -@size[0] or self.opacity == 0
  119.               self.visible = false
  120.               self.opacity = 0
  121.               self.x = -@size[0]
  122.            end   
  123.         else
  124.            self.x += SLIDE_SPEED if self.x < @size[1]
  125.            self.x = @size[1] if self.x > @size[1]
  126.            self.opacity += 10 if self.opacity < PICTURE_OPACITY
  127.            self.opacity = PICTURE_OPACITY if self.opacity > PICTURE_OPACITY
  128.            update_breath_effect
  129.       end         
  130.   end
  131.   
  132.   #--------------------------------------------------------------------------
  133.   # ● Update Breath Effect
  134.   #--------------------------------------------------------------------------   
  135.   def update_breath_effect
  136.       return if !BREATH_EFFECT
  137.       @breach_effect[1] += 1
  138.       case @breach_effect[1]
  139.          when 0..30
  140.              @breach_effect[0] += 0.0004
  141.          when 31..50
  142.              @breach_effect[0] -= 0.0004
  143.          else  
  144.          @breach_effect[1] = 0
  145.          @breach_effect[0] = 1.truncate
  146.       end
  147.       self.zoom_y = @breach_effect[0]
  148.   end  
  149.   
  150. end

  151. #===============================================================================
  152. # ■ Spriteset_Battle
  153. #===============================================================================
  154. class Spriteset_Battle
  155.   
  156.   #--------------------------------------------------------------------------
  157.   # ● Create Actors
  158.   #--------------------------------------------------------------------------   
  159.   alias mog_battler_cm_create_actors create_actors
  160.   def create_actors
  161.       mog_battler_cm_create_actors
  162.       create_battler_pictures
  163.   end
  164.   
  165.   #--------------------------------------------------------------------------
  166.   # ● Dispose
  167.   #--------------------------------------------------------------------------   
  168.   alias mog_battler_cm_dispose dispose
  169.   def dispose
  170.       mog_battler_cm_dispose
  171.       dispose_battler_cm
  172.   end  

  173.   #--------------------------------------------------------------------------
  174.   # ● Update
  175.   #--------------------------------------------------------------------------   
  176.   alias mog_battler_cm_update update
  177.   def update
  178.       mog_battler_cm_update
  179.       update_battler_cm
  180.   end   

  181.   #--------------------------------------------------------------------------
  182.   # ● Create Battler Pictures
  183.   #--------------------------------------------------------------------------   
  184.   def create_battler_pictures
  185.       size = 0
  186.       @battler_pictures = []
  187.       for i in $game_party.members
  188.           @battler_pictures.push(Sprite_Battler_CM.new(@viewport1,i.id))
  189.           size += 1
  190.           break if size > 3
  191.       end   
  192.   end   
  193.   
  194.   #--------------------------------------------------------------------------
  195.   # ● Dispose Battler CM
  196.   #--------------------------------------------------------------------------   
  197.   def dispose_battler_cm
  198.       return if @battler_pictures == nil
  199.       @battler_pictures.each {|sprite| sprite.dispose }
  200.   end  

  201.   #--------------------------------------------------------------------------
  202.   # ● Update Battler CM
  203.   #--------------------------------------------------------------------------   
  204.   def update_battler_cm
  205.       return if @battler_pictures == nil
  206.       @battler_pictures.each {|sprite| sprite.update }
  207.   end   
  208.      
  209.   #--------------------------------------------------------------------------
  210.   # ● Update CM Pictures
  211.   #--------------------------------------------------------------------------      
  212.   def update_cm_picture(cm_visible, battler_index)
  213.       return if @battler_pictures == nil
  214.       @battler_pictures.each {|sprite| sprite.refresh_battler(cm_visible, battler_index) }
  215.   end  
  216.   
  217. end

  218. #===============================================================================
  219. # ■ Scene_Battle
  220. #===============================================================================
  221. class Scene_Battle < Scene_Base
  222.   
  223.   #--------------------------------------------------------------------------
  224.   # ● Update
  225.   #--------------------------------------------------------------------------        
  226.   alias mog_cm_picture_update update
  227.   def update
  228.       mog_cm_picture_update  
  229.       update_picture_visible
  230.   end  
  231.   
  232.   #--------------------------------------------------------------------------
  233.   # ● Update Battler CM Active
  234.   #--------------------------------------------------------------------------      
  235.   def update_picture_visible
  236.       return if @actor_command_window == nil
  237.       cm_visible = can_cm_picture_visible?      
  238.       cm_id = BattleManager.actor.id rescue -1
  239.       @spriteset.update_cm_picture(cm_visible, cm_id)
  240.   end  
  241.   
  242.   #--------------------------------------------------------------------------
  243.   # ● Can CM Picture Visible
  244.   #--------------------------------------------------------------------------        
  245.   def can_cm_picture_visible?
  246.       return false if (@actor_window.active or @enemy_window.active) rescue return
  247.       return false if BattleManager.actor == nil      
  248.       return true
  249.   end  
  250.   
  251.   #--------------------------------------------------------------------------
  252.   # ● Execute Action
  253.   #--------------------------------------------------------------------------        
  254.   alias mog_cm_picture_execute_action execute_action
  255.   def execute_action
  256.       @spriteset.update_cm_picture(false, -1) if @spriteset != nil
  257.       mog_cm_picture_execute_action
  258.   end
  259.   
  260. end

  261. $mog_rgss3_actor_picture_cm = true
复制代码


PS:我知道可以關掉敵人的AP條,可是覺得這樣失去了ATB系統的意義...所以不太希望就是...希望提供解決方法 謝謝

点评

moy
忘记点回复了。。点评提醒一下,你看这样的解决方式是否合适  发表于 2013-9-9 22:41

无节操

梦石
0
星屑
608
在线时间
795 小时
注册时间
2009-2-6
回帖
3910

开拓者贵宾

发表于 2013-9-9 22:40:25 | 显示全部楼层
我记得在某贴看到过类似的问题,问题的核心在于,修改z值只是在一个viewport内,而显示图片与绘制ap槽在两个不同的viewport,其中图片是优先级较低的一个,所以总是显示在下面。
除了将两者放入同一个viewport这样变扭的更改之外,不知楼主是否考虑在显示图片时(也就是你这个立绘),暂时屏蔽敌人的ap,这样就规避了这个问题。在你提供的脚本中也确实有这样的操作,应该可以实现。
  1.   #敵ゲージ非表示設定
  2.   ENEMY_AP_GAUGE_HIDE_SWITCH = 91      #スイッチがオンになっている間
  3.   ENEMY_AP_GAUGE_HIDE_IN_TURN = true #ターン中
  4.   ENEMY_AP_GAUGE_HIDE_ANIMATION =     #アニメーション表示中
复制代码
如果你必须立绘和ap同时显示……那么既然ap必然会被挡住……是否有必要即使挡住也要描绘?

点评

in turn那個我一開始也以為是主角行動時ap不顯示,結果是...敵人行動時ap不顯示... 可是我又不想用開關直接把ap關掉...ap擋住沒關係  发表于 2013-9-9 23:09
Brandnew day, Brandnew Life
                             规 实在  中
暂为素材区版主,版其  琢磨
应援一下~
RPG制作大师授权素材推广计划
回复

使用道具 举报

无节操

梦石
0
星屑
608
在线时间
795 小时
注册时间
2009-2-6
回帖
3910

开拓者贵宾

发表于 2013-9-10 00:02:18 | 显示全部楼层
  1. class Sprite_Enemy_Gauge < Sprite_Base
  2.   #--------------------------------------------------------------------------
  3.   # ● オブジェクト初期化
  4.   #--------------------------------------------------------------------------
  5.   def initialize(battler, viewport, gauge_number = nil)
  6.     super(Viewport.new(0, 0, Graphics.width, Graphics.height))
  7.     self.viewport.z = 0
复制代码
那么就在如这样的位置直接更改viewport的值吧……我才注意到他是新建的viewport……你可以改个略大一点的值(越大越靠后)图片的viewport用的是viewport2,也就是50 , 0好像是最高的。。。要不你给这个改成60试试,我自己没改过viewport的东西……

点评

不然我把其他腳本也貼上來?如果上面網址開不了的話  发表于 2013-9-10 09:33
Brandnew day, Brandnew Life
                             规 实在  中
暂为素材区版主,版其  琢磨
应援一下~
RPG制作大师授权素材推广计划
回复

使用道具 举报

梦石
0
星屑
275
在线时间
54 小时
注册时间
2012-12-28
回帖
19
 楼主| 发表于 2013-9-10 09:32:23 | 显示全部楼层
  1. class Sprite_Enemy_Gauge < Sprite_Base
  2.   #--------------------------------------------------------------------------
  3.   # ● オブジェクト初期化
  4.   #--------------------------------------------------------------------------
  5.   def initialize(battler, viewport, gauge_number = nil)
  6.     super(Viewport.new(0, 0, Graphics.width, Graphics.height))
  7.     self.viewport.z = viewport.z
复制代码
原來是這樣的
那個0好像是我亂改沒改回的東西
嘗試過調整self.viewport.z的值,100以上,100以下也試過
但怎樣也是蓋住了立繪
self.viewport.z=多少也是蓋住了立繪(:3_|Z
回复

使用道具 举报

无节操

梦石
0
星屑
608
在线时间
795 小时
注册时间
2009-2-6
回帖
3910

开拓者贵宾

发表于 2013-9-10 09:43:14 | 显示全部楼层
wai781300 发表于 2013-9-10 09:32
原來是這樣的
那個0好像是我亂改沒改回的東西
嘗試過調整self.viewport.z的值,100以上,100 ...

哎,不行吗
那我就搞不太明白了。看看有没有别人能帮你解决吧。viewport这一块我没仔细啃过
Brandnew day, Brandnew Life
                             规 实在  中
暂为素材区版主,版其  琢磨
应援一下~
RPG制作大师授权素材推广计划
回复

使用道具 举报

梦石
0
星屑
275
在线时间
54 小时
注册时间
2012-12-28
回帖
19
 楼主| 发表于 2013-9-10 09:47:42 | 显示全部楼层
解決了 直接問日本那邊的製作者...
有關回覆:
スクリプトのセクション「50 敵APゲージ描画」の 2箇所 を変えます。

①61~63 行
> super(Viewport.new(0, 0, Graphics.width, Graphics.height))
> self.viewport.z = viewport.z
> self.bitmap = Bitmap.new(Graphics.width, Graphics.height)
これを変えて
> super(viewport)
> self.z = 101
> self.bitmap = Bitmap.new(Graphics.width, Graphics.height)
これにします。

②77~81行目
> def update_rect(x, y, z)
> self.viewport.rect.x = x - @gauge_width / 2
> self.viewport.rect.y = y - @gauge_high
> self.viewport.rect.y += ATB::ENEMY_GAUGE_POS_DATA[@gauge_number]
> end
これを変えて
> def update_rect(x, y, z)
> self.x = x - @gauge_width / 2
> self.y = y - @gauge_high
> self.y += ATB::ENEMY_GAUGE_POS_DATA[@gauge_number]
> end
これにします。


Z値(深さ)は 62行目
> self.z = 101
で調整できるようになります。

点评

moy
哦哦,解决了就好,棒~  发表于 2013-9-10 11:29
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部