赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 2977 |
最后登录 | 2020-5-5 |
在线时间 | 5 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 60
- 在线时间
- 5 小时
- 注册时间
- 2008-6-28
- 帖子
- 292
|
class Sprite < ::Sprite类中def animation_set_sprites方法- def animation_set_sprites(sprites, cell_data, position, invisible = false)
- if invisible
- for i in 0..15
- sprites[i].visible = false
- end
- return
- end
- 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 - 225
- 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]
- sprite.z = 1000
- 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
复制代码 这个就是数据库动画播放器(rm自带就有,不过这个是我从取消循环动画脚本中抽出来的),其中sprite.z = 1000这句就是动画的z坐标(它的意思是数据库动画播放所用的精灵的z坐标是1000,自己改吧),这个是内部类,不要郁闷了,还不如看看说明书。。。。你以为个个都这么高手啊。。。还就是分才100,问题又这么另类。。呵呵,好心也给多点了。。。。{/gg} |
|