赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 20825 |
最后登录 | 2013-3-5 |
在线时间 | 3 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 3 小时
- 注册时间
- 2008-8-10
- 帖子
- 243
|
以下引用qcc001于2008-9-21 12:34:24的发言:
module RPG
class Sprite < ::Sprite
def animation_set_sprites(sprites, cell_data, position)
for i in 0..15
sprite = sprites
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 - 100
sprite.y = self.viewport.rect.height / 2 - 100
else
sprite.x = 320
sprite.y = 240
sprite.z = 2000
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
sprite.z = self.z + 1
end
sprite.x += cell_data[i, 1]
sprite.y += cell_data[i, 2]
########################################
case @_animation.id
when 6, 9 #动画编号,自己设定
sprite.z = self.z + 1 #数字,战斗图的z坐标
when 7, 8
sprite.z = self.z
else
sprite.z = 2000
end
###########################################
sprite.ox = 96
sprite.oy = 96
#sprite.z = self.z + 1
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
感谢这位朋友提出的意见!如果还有多一些志同道合的朋友一起研究那就好了! |
|