查看: 1199|回复: 1

求問動畫坐標問題.....

  [复制链接]
梦石
0
星屑
55
在线时间
1 小时
注册时间
2007-4-18
回帖
30
发表于 2008-12-22 06:28:23 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
關於全動畫的那段動畫坐標腳本
使用方動畫在敵方待機動畫下面
而對象方動畫在敵方待機動畫上面
能不能改成 兩個動畫都在敵方待機上面
此贴于 2008-12-24 12:06:30 被版主darkten提醒,请楼主看到后对本贴做出回应。
版务信息:版主帮忙结贴~

蚂蚁卡卡

梦石
0
星屑
116
在线时间
66 小时
注册时间
2007-12-16
回帖
2991
发表于 2008-12-24 05:40:20 | 显示全部楼层
  1. def animation_set_sprites(sprites, cell_data, position)
  2.       for i in 0..15
  3.         sprite = sprites[i]
  4.         pattern = cell_data[i, 0]
  5.         if sprite == nil or pattern == nil or pattern == -1
  6.           sprite.visible = false if sprite != nil
  7.           next
  8.         end
  9.         sprite.visible = true
  10.         sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
  11.         if position == 3
  12.           if self.viewport != nil
  13.             sprite.x = self.viewport.rect.width / 2
  14.             sprite.y = self.viewport.rect.height - 160
  15.           else
  16.             sprite.x = 320
  17.             sprite.y = 240
  18.           end
  19.         else
  20.           sprite.x = self.x - self.ox + self.src_rect.width / 2
  21.           sprite.y = self.y - self.oy + self.src_rect.height / 2
  22.           sprite.y -= self.src_rect.height / 4 if position == 0
  23.           sprite.y += self.src_rect.height / 4 if position == 2
  24.         end
  25.         sprite.x += cell_data[i, 1]
  26.         sprite.y += cell_data[i, 2]
  27.         sprite.z =1
  28.         sprite.ox = 96
  29.         sprite.oy = 96
  30.         sprite.zoom_x = cell_data[i, 3] / 100.0
  31.         sprite.zoom_y = cell_data[i, 3] / 100.0
  32.         sprite.angle = cell_data[i, 4]
  33.         sprite.mirror = (cell_data[i, 5] == 1)
  34.         sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  35.         sprite.blend_type = cell_data[i, 7]
  36.       end
复制代码


放到  class Sprite < ::Sprite

初始化 下面

例如:
系统信息:本贴由本区版主认可为正确答案,66RPG感谢您的热情解答~
《隋唐乱》完整解密版点击进入
米兰,让我怎么说离开……

曾经我也是一个有志青年,直到我膝盖中了一箭……

《隋唐乱》博客地址
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部