|
比较简单,一共就那么几行脚本,废话少说。
Game_Character 加一个动画缩放的比率
attr_accessor :ad_zoom # 动画缩放
初始化里添加 @ad_zoom = 1 这个是100%大小
Sprite_Base
def animation_set_sprites(frame) 改成下面这样,做手脚的地方我都做标记了
- #--------------------------------------------------------------------------
- # ● 设置动画活动块
- # frame : 画面数据 (RPG::Animation::Frame)
- #--------------------------------------------------------------------------
- def animation_set_sprites(frame)
- cell_data = frame.cell_data
- for i in 0..15
- sprite = @animation_sprites[i]
- next if sprite == nil
- pattern = cell_data[i, 0]
- if pattern == nil or pattern == -1
- sprite.visible = false
- next
- end
- if pattern < 100
- sprite.bitmap = @animation_bitmap1
- else
- sprite.bitmap = @animation_bitmap2
- end
- sprite.visible = true
- sprite.src_rect.set(pattern % 5 * 192,
- pattern % 100 / 5 * 192, 192, 192)
- if @animation_mirror
- #------------------------------------------------------------------
- if $game_temp.in_battle
- sprite.x = @animation_ox - cell_data[i, 1]
- sprite.y = @animation_oy - cell_data[i, 2]
- else
- sprite.x = @animation_ox - @character.ad_zoom * cell_data[i, 1]
- sprite.y = @animation_oy - @character.ad_zoom * cell_data[i, 2]
- end
- #------------------------------------------------------------------
- sprite.angle = (360 - cell_data[i, 4])
- sprite.mirror = (cell_data[i, 5] == 0)
- else
- #------------------------------------------------------------------
- if $game_temp.in_battle
- sprite.x = @animation_ox + cell_data[i, 1]
- sprite.y = @animation_oy + cell_data[i, 2]
- else
- sprite.x = @animation_ox + @character.ad_zoom * cell_data[i, 1]
- sprite.y = @animation_oy + @character.ad_zoom * cell_data[i, 2]
- end
- #------------------------------------------------------------------
- sprite.angle = cell_data[i, 4]
- sprite.mirror = (cell_data[i, 5] == 1)
- end
- sprite.z = self.z + 300
- sprite.ox = 96
- sprite.oy = 96
- sprite.zoom_x = cell_data[i, 3] / 100.0
- sprite.zoom_y = cell_data[i, 3] / 100.0
- #---------------------------------------------------
- if $game_temp.in_battle
- sprite.zoom_x = sprite.zoom_x
- sprite.zoom_y = sprite.zoom_y
- else
- sprite.zoom_x = @character.ad_zoom * sprite.zoom_x
- sprite.zoom_y = @character.ad_zoom * sprite.zoom_y
- end
- #---------------------------------------------------
- sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
- sprite.blend_type = cell_data[i, 7]
- end
- end
复制代码 #---------------------------------------------------
if $game_temp.in_battle
sprite.zoom_x = sprite.zoom_x
sprite.zoom_y = sprite.zoom_y
else
sprite.zoom_x = @character.ad_zoom * sprite.zoom_x
sprite.zoom_y = @character.ad_zoom * sprite.zoom_y
end
#---------------------------------------------------
改成
#---------------------------------------------------
unless $game_temp.in_battle
sprite.zoom_x = @character.ad_zoom * sprite.zoom_x
sprite.zoom_y = @character.ad_zoom * sprite.zoom_y
end
#---------------------------------------------------
这样比较好
调用方法,动画还是用事件调用,在之前只要用脚本改变一下动画比率就可以了
$game_map.events[1].ad_zoom = 0.25
事件指令:显示动画 事件1 [毒]
对那句脚本说明一下
[1] 这个里面添的是地图中事件的编号,那个事件播放动画要缩放就添那个的编号
0.25是缩小为 25%,个人觉得 0.25比较适合事件的大小
这个自己改好了
2就是200% 类推一下就OK
PS:刚开始的作品在战斗是会有BUG而报错,现在已经没有问题了,这个脚本是不会影响战斗中动画的播放的
解说完毕,我闪人 |
|