Project1

标题: 关于屏幕魔法 [打印本页]

作者: Arche    时间: 2009-8-3 14:43
标题: 关于屏幕魔法
做了个全屏全体魔法,但是位置不对,偏下了。
如果选中位置就对了
但是每个人都出现魔法效果
用了全体滑动可是在上面的部分已经到顶,下面的挤上来变得扭曲
请问怎么解决
作者: darkten    时间: 2009-8-3 14:48
数据库设置动画的时候,位置一项设置为“画面”...
作者: Arche    时间: 2009-8-3 14:55
就是选了画面位置偏下。。
作者: 夏季冰川    时间: 2009-8-3 16:00
要选画面(代表队全体敌人只播放一次动画),不能选偏下或偏上,不然动画就会重叠起来。
作者: Arche    时间: 2009-8-3 16:29
就是选了画面还偏下了。。
作者: 夏季冰川    时间: 2009-8-3 16:41
5# Arche


那是你的动画设置有问题了,建议吧你动画里所有帧的图的y坐标都往上调。
作者: Arche    时间: 2009-8-3 16:44
已经调过了
用了全体滑动本身就在最上面的不能再上,在下面的会挤上来重叠一起
一开始就说了啊
作者: 夏季冰川    时间: 2009-8-3 16:47
你的魔法很大吗?
作者: Arche    时间: 2009-8-3 16:57
全屏。。640*480用6帧拼起来的

就是数据库动画设置选画面的时候的中间实际上不是画面的中间,
战斗的时候上面还有一条框显示技能名字,而数据库设置那里的中间
是减去这部分再除以2,不是整个画面的中间所以偏下的

假设是高480,中间就是240,但是数据库的中间是
480-40再除以2所以偏下了,40就是现实技能名字的那个框

我是想设在画面的中间,但是总是偏下了
作者: 夏季冰川    时间: 2009-8-3 17:08
你把魔法素材在动画里缩小试试看。
作者: Arche    时间: 2009-8-3 17:11
试了
不行,如果能调整动画显示的坐标就行
作者: darkten    时间: 2009-8-5 14:29
你可否截一张数据库中设置这个动画的图,有点难以想象实际情况...

或者建议你用ps处理一下会比较好...
作者: veal    时间: 2009-8-5 14:50
  1. module RPG
  2.   class Sprite < ::Sprite
  3.     def animation_set_sprites(sprites, cell_data, position)
  4.       for i in 0..15
  5.         sprite = sprites[i]
  6.         pattern = cell_data[i, 0]
  7.         if sprite == nil or pattern == nil or pattern == -1
  8.           sprite.visible = false if sprite != nil
  9.           next
  10.         end
  11.         sprite.visible = true
  12.         sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
  13.         if position == 3
  14.           #if self.viewport != nil
  15.           #  sprite.x = self.viewport.rect.width / 2
  16.           #  sprite.y = self.viewport.rect.height - 160
  17.           #else
  18.             sprite.x = 320
  19.             sprite.y = 240
  20.           #end
  21.         else
  22.           sprite.x = self.x - self.ox + self.src_rect.width / 2
  23.           sprite.y = self.y - self.oy + self.src_rect.height / 2
  24.           sprite.y -= self.src_rect.height / 4 if position == 0
  25.           sprite.y += self.src_rect.height / 4 if position == 2
  26.         end
  27.         sprite.x += cell_data[i, 1]
  28.         sprite.y += cell_data[i, 2]
  29.         sprite.z = 2000
  30.         sprite.ox = 96
  31.         sprite.oy = 96
  32.         sprite.zoom_x = cell_data[i, 3] / 100.0
  33.         sprite.zoom_y = cell_data[i, 3] / 100.0
  34.         sprite.angle = cell_data[i, 4]
  35.         sprite.mirror = (cell_data[i, 5] == 1)
  36.         sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  37.         sprite.blend_type = cell_data[i, 7]
  38.       end
  39.     end
  40.   end
  41. end
复制代码
强制全屏动画在画面中央,把这段脚本扔到脚本编辑器里面试试




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1