查看: 1889|回复: 2

[已经解决] 怎么样使动画播放的透明度不跟行走图透明度一样

[复制链接]
梦石
0
星屑
12161
在线时间
4435 小时
注册时间
2014-4-11
回帖
5616

开拓者

发表于 2016-6-19 19:43:57 | 显示全部楼层 |阅读模式

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

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

×
我发现,当把事件的行走图“不透明度”降低,行走图会透明,此时播放的动画也会透明。
我想要动画的透明度不要随着这个变化

评分

参与人数 1星屑 +35 收起 理由
RyanBern + 35 手动认可奖励

查看全部评分

素材区好人

梦石
5
星屑
12559
在线时间
4347 小时
注册时间
2011-7-21
回帖
2264

超评测参与极短28参与极短27参与极短26参与极短25参与极短24参与极短23参与极短22参与极短21参与

发表于 2016-6-19 22:02:00 | 显示全部楼层
新建一个事件,该事件的坐标移动到与主角相同,之后动画目标为该事件

点评

不是,我不要伪的,我就是要改这个。系统需要  发表于 2016-6-19 22:18
回复

使用道具 举报

梦石
0
星屑
9716
在线时间
2775 小时
注册时间
2008-9-5
回帖
3458

开拓者短篇八RM组冠军短篇九导演组亚军白银编剧

发表于 2016-6-20 15:43:48 | 显示全部楼层
  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.         ############################
  37.         # sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
  38.         sprite.opacity = cell_data[i, 6]
  39.         ############################
  40.         sprite.blend_type = cell_data[i, 7]
  41.       end
  42.     end
  43.   end
  44. end
复制代码
Main前插入,后果是所有子类播放的动画都不会和本体同步不透明度。

点评

有效。谢谢。这样好。子动画跟着透明的功能我用不到。  发表于 2016-6-20 18:20

评分

参与人数 1梦石 +1 收起 理由
RyanBern + 1 认可答案

查看全部评分

回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部