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

Project1

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

[已经解决] 請教顯示動畫的修改。

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1095
在线时间
381 小时
注册时间
2010-10-9
帖子
386

开拓者

1
发表于 2015-7-3 12:42:04 | 显示全部楼层
  1. #===============================================================================
  2. #最后一帧会被保留的动画的id
  3. $animation_hold = [1,2]
  4. #===============================================================================
  5. module RPG
  6.   class Sprite < ::Sprite
  7. #=================================================================================  
  8.     def update_animation
  9.       if @_animation_duration > 0
  10.         frame_index = @_animation.frame_max - @_animation_duration
  11.         cell_data = @_animation.frames[frame_index].cell_data
  12.         position = @_animation.position
  13.         animation_set_sprites(@_animation_sprites, cell_data, position)
  14.         for timing in @_animation.timings
  15.           if timing.frame == frame_index
  16.             animation_process_timing(timing, @_animation_hit)
  17.           end
  18.         end
  19.       elsif $animation_hold.include?(@_animation.id)
  20.          return
  21.       else
  22.         dispose_animation
  23.       end
  24.     end
  25. end
  26. end
复制代码
上面只是保留最后一帧
至于如何把最后一帧去掉,比较简单,楼主根据自己的需要去写好了。

评分

参与人数 1梦石 +1 收起 理由
RyanBern + 1 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-3 23:38

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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