Project1

标题: 请教 [打印本页]

作者: rphy    时间: 2007-7-7 20:19
标题: 请教
有没有办法在战斗时更改角色战斗图透明度 [LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: rphy    时间: 2007-7-7 20:19
标题: 请教
有没有办法在战斗时更改角色战斗图透明度 [LINE]1,#dddddd[/LINE]版务信息:本贴由楼主自主结贴~
作者: 彼岸海棠    时间: 2007-7-7 21:46
直接插入main前的脚本如下:

module RPG
class Sprite < ::Sprite
   def animation(animation, hit)
     dispose_animation
     @_animation = animation
     return if @_animation == nil
     @_animation_hit = hit
     @_animation_duration = @_animation.frame_max
     animation_name = @_animation.animation_name
     animation_hue = @_animation.animation_hue
     bitmap = RPG::Cache.animation(animation_name, animation_hue)
     if @@_reference_count.include?(bitmap)
       @@_reference_count[bitmap] += 1
     else
       @@_reference_count[bitmap] = 1
     end
     @_animation_sprites = []
     if @_animation.position != 3 or not @@_animations.include?(animation)
       for i in 0..15
         sprite = ::Sprite.new(self.viewport)
         sprite.bitmap = bitmap
         sprite.visible = false
         @_animation_sprites.push(sprite)
       end
       unless @@_animations.include?(animation)
         @@_animations.push(animation)
       end
     end
     update_animation
   end
   def update_animation
     if @_animation_duration > 0
       self.opacity = 255
       frame_index = @_animation.frame_max - @_animation_duration
       cell_data = @_animation.frames[frame_index].cell_data
       position = @_animation.position
       animation_set_sprites(@_animation_sprites, cell_data, position)
       for timing in @_animation.timings
         if timing.frame == frame_index
           animation_process_timing(timing, @_animation_hit)
         end
       end
     else
       self.opacity = 220
       dispose_animation
     end
   end
end
end
________________________________________

然后在Sprite_Battler找到这段
if @battler.is_a?(Game_Actor) and @battler_visible
     # 不是主状态的时候稍稍降低点透明度
     if $game_temp.battle_main_phase
       self.opacity += 3 if self.opacity < 255
     else
       self.opacity -= 3 if self.opacity > 207
     end
   end

改为:

if @battler_visible
     if self.opacity >125
       self.opacity -= 5
     end
   end

就OK了。if self.opacity >125的125这个数字是透明度,可以自己改。
恩,这个脚本,好想黑暗圣剑里也用到了,LZ可以试试 [LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者: rphy    时间: 2007-7-7 23:04

谢谢




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1