设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1029|回复: 5
打印 上一主题 下一主题

关于全屏动画问题

 关闭 [复制链接]
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-8-18
帖子
458
跳转到指定楼层
1
发表于 2008-8-10 05:30:10 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽

Lv1.梦旅人

梦石
0
星屑
50
在线时间
27 小时
注册时间
2008-2-13
帖子
1740
2
发表于 2008-8-10 05:37:24 | 只看该作者
播放动画的位置你没选对吧

在地图上设置个空白事件,用事件中的显示动画,操作那个空白事件播放动画


或者,使用连续播放图片的办法:http://rpg.blue/web/htm/news261.htm
好吧,果然换个签名就没人认识我了。我承认我被时间埋没了
回复 支持 反对

使用道具 举报

Lv1.梦旅人

辉瑞中国首席研究员<

梦石
0
星屑
50
在线时间
142 小时
注册时间
2008-1-18
帖子
2129
3
发表于 2008-8-10 05:42:09 | 只看该作者
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
            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]
        sprite.z = 2000
        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


sprite.y = self.viewport.rect.height - 160
改成
sprite.y = self.viewport.rect.height - 300
来6r就是等某位仁兄的巨坑

褴褛着身行无端,囊中羞涩空心酸。
平生几无得意事,倒塔泡面宅寝室。
惟羡隔壁高帅富,雨露春风月夜声。
青丝无处觅其踪,只有硬盘苍井空。
莫云男儿空悲愁,鸿鹄岂不天际游。
坐断天下执鹿首,千百金帛万兜鍪。
夜深忽梦某年月,再见女神欲语迟。
吊丝终有逆袭日,木耳再无回粉时。
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2007-8-18
帖子
458
4
 楼主| 发表于 2008-8-10 06:33:10 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
39930
在线时间
5802 小时
注册时间
2006-11-10
帖子
6678
5
发表于 2008-8-10 12:02:08 | 只看该作者
MAIN前直接插入,因为你把战斗场景改成640*480,所以,屏幕中间就是640.480的中间。

动画高只有320,自然显得靠下了。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

辉瑞中国首席研究员<

梦石
0
星屑
50
在线时间
142 小时
注册时间
2008-1-18
帖子
2129
6
发表于 2008-8-10 17:56:23 | 只看该作者
  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 - 300         
  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
复制代码


插入到MAIN前

系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
来6r就是等某位仁兄的巨坑

褴褛着身行无端,囊中羞涩空心酸。
平生几无得意事,倒塔泡面宅寝室。
惟羡隔壁高帅富,雨露春风月夜声。
青丝无处觅其踪,只有硬盘苍井空。
莫云男儿空悲愁,鸿鹄岂不天际游。
坐断天下执鹿首,千百金帛万兜鍪。
夜深忽梦某年月,再见女神欲语迟。
吊丝终有逆袭日,木耳再无回粉时。
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2025-7-28 00:23

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表