1.42 MB, 下载次数: 73
范例
VIPArcher 发表于 2014-7-11 11:38
我试了一下,FPS无变化(按F2查看),楼主觉得卡的原因应该是每帧的都移动一次,视觉上看起来不连贯的原因 ...
#-------------------------------------------------------------------------- # ● 更新动画 #-------------------------------------------------------------------------- def update_animation return unless animation? @ani_duration -= 1 if @ani_duration % 1 == 0 if @ani_duration > 0 frame_index = @animation.frame_max frame_index -= 1+ @ani_duration / @ani_rate animation_set_sprites(@animation.frames[frame_index]) if @ani_duration % @ani_rate == 0 @animation.timings.each do |timing| animation_process_timing(timing) if timing.frame == frame_index end end else end_animation end end end
@animation.timings.each do |timing| animation_process_timing(timing) if timing.frame == frame_index end
如何让动画每帧更新一次
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |