| 赞 | 27  | 
 
| VIP | 400 | 
 
| 好人卡 | 13 | 
 
| 积分 | 17 | 
 
| 经验 | 69730 | 
 
| 最后登录 | 2025-8-2 | 
 
| 在线时间 | 3039 小时 | 
 
 
 
 
 
Lv3.寻梦者 (暗夜天使) 精灵族の天使 
	- 梦石
 - 0 
 
        - 星屑
 - 1707 
 
        - 在线时间
 - 3039 小时
 
        - 注册时间
 - 2007-3-16
 
        - 帖子
 - 33731
 
 
   
 
 | 
	
 
- module RPG
 
 -   class Sprite < ::Sprite
 
 -     def update_loop_animation
 
 -       frame_index = @_loop_animation_index
 
 -       cell_data = @_loop_animation.frames[frame_index].cell_data
 
 -       position = @_loop_animation.position
 
 -       animation_set_sprites(@_loop_animation_sprites, cell_data, position)
 
 -   ###########################################################################
 
 -       case @_loop_animation.id
 
 -       # 这里设定状态的循环动画ID,只需要填写会被角色盖住的,其他不需要。
 
 -       when 199
 
 -         for i in 0..15
 
 -           @_loop_animation_sprites[i].z = 0
 
 -         end
 
 -       end
 
 -   ###########################################################################
 
 -       for timing in @_loop_animation.timings
 
 -         if timing.frame == frame_index
 
 -           animation_process_timing(timing, true)
 
 -         end
 
 -       end
 
 -     end
 
 -     def animation_set_sprites(sprites, cell_data, position)
 
 -       for i in 0..15
 
 -         sprite = sprites[i]
 
 -         pattern = cell_data[i, 0]
 
 -         if sprite == nil or pattern == nil or pattern == -1
 
 -           sprite.visible = false if sprite != nil
 
 -         next
 
 -       end
 
 -       sprite.visible = true
 
 -       sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
 
 -       if position == 3
 
 -         if self.viewport != nil
 
 -           sprite.x = self.viewport.rect.width / 2
 
 -           sprite.y = self.viewport.rect.height - 160
 
 -         else
 
 -           sprite.x = 320
 
 -           sprite.y = 240
 
 -         end
 
 -       else
 
 -         sprite.x = self.x - self.ox + self.src_rect.width / 2
 
 -         sprite.y = self.y - self.oy + self.src_rect.height / 2
 
 -         sprite.y -= self.src_rect.height / 4 if position == 0
 
 -         sprite.y += self.src_rect.height / 4 if position == 2
 
 -       end
 
 -       sprite.x += cell_data[i, 1]
 
 -       sprite.y += cell_data[i, 2]
 
 -   ###########################################################################
 
 -       case @_animation.id
 
 -       # 这边的动画指得是战斗时后的出招,挨打动画,并非状态的循环动画。
 
 -       when 198..199,203..204 # 需要被角色盖住的动画编号,自己设定
 
 -         sprite.z = 0
 
 -       when 1..197, 200..202,205..210 # 其他的动画编号
 
 -         sprite.z = 2000
 
 -       end
 
 -   ###########################################################################
 
 -       sprite.ox = 96
 
 -       sprite.oy = 96
 
 -       sprite.zoom_x = cell_data[i, 3] / 100.0
 
 -       sprite.zoom_y = cell_data[i, 3] / 100.0
 
 -       sprite.angle = cell_data[i, 4]
 
 -       sprite.mirror = (cell_data[i, 5] == 1)
 
 -       sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
 
 -       sprite.blend_type = cell_data[i, 7]
 
 -       end
 
 -     end
 
 -   end
 
 - end
 
 
  复制代码 
算了,直接贴脚本吧。 
将此脚本粘贴到main前面,然后仔细设置每个动画的坐标吧 |   
 
 
 
 |