| 
 
| 赞 | 0 |  
| VIP | 0 |  
| 好人卡 | 0 |  
| 积分 | 1 |  
| 经验 | 4891 |  
| 最后登录 | 2017-2-9 |  
| 在线时间 | 82 小时 |  
 Lv1.梦旅人 
	梦石0 星屑50 在线时间82 小时注册时间2013-1-28帖子58 | 
4楼
 
 
 楼主|
发表于 2014-3-1 11:36:55
|
只看该作者 
| #-------------------------------------------------------------------------- # ● 更新源矩形
 #--------------------------------------------------------------------------
 def update_src_rect
 sign = @character_name[/^[\!\$]./]
 if sign && sign.include?('$%')
 if [email protected]?
 self.bitmap = Cache.character(@character_name+'run')
 @cw = bitmap.width / 6
 @ch = bitmap.height
 self.ox = @cw / 1.6
 self.oy = @ch /1.1
 else
 self.bitmap = Cache.character(@character_name)
 @cw = bitmap.width / 10
 @ch = bitmap.height
 self.ox = @cw / 1.6
 self.oy = @ch /1.1
 end
 end
 if @tile_id == 0
 index = @character.character_index
 pattern = @character.pattern < 3 ? @character.pattern : 1
 sx = (index % 4 * 3 + pattern) * @cw
 sy = (index / 4 * 4 + (@character.direction - 2) / 2) * @ch #+(6/2)*@ch
 self.src_rect.set(sx, 0, @cw, @ch)  #self.src_rect.set(sx, sy, @cw, @ch)
 end
 end
 
 改了之后,可以实现切换角色行走图,但是会出现一顿一顿的感觉,这是为什么呢?
 | 
 |