赞 | 1 |
VIP | 220 |
好人卡 | 25 |
积分 | 7 |
经验 | 51477 |
最后登录 | 2013-1-12 |
在线时间 | 943 小时 |
Lv2.观梦者 花开堪折直须折
- 梦石
- 0
- 星屑
- 681
- 在线时间
- 943 小时
- 注册时间
- 2010-7-17
- 帖子
- 4963
|
- #==============================================================================
- # ■ VX_非官方补丁 1 [动画显示相关修正] —— By 诡异の猫
- #------------------------------------------------------------------------------
- # 注意: 此补丁包括官方补丁 VX_SP1
- #------------------------------------------------------------------------------
- # 补丁内容: 修正地图上播放动画(以画面为中心除外),动画跟随画面移动问题.
- #==============================================================================
- class Sprite_Base < Sprite
- #--------------------------------------------------------------------------
- # ● 开始播放动画
- #--------------------------------------------------------------------------
- def start_animation(animation, mirror = false)
- dispose_animation
- @animation = animation
- return if @animation == nil
- @animation_mirror = mirror
- @animation_duration = @animation.frame_max * 4 + 1
- load_animation_bitmap
- @animation_sprites = []
- if @animation.position != 3 or not @@animations.include?(animation)
- if @use_sprite
- for i in 0..15
- sprite = ::Sprite.new(viewport)
- sprite.visible = false
- @animation_sprites.push(sprite)
- end
- unless @@animations.include?(animation)
- @@animations.push(animation)
- end
- end
- end
- update_animation
- end
- #--------------------------------------------------------------------------
- # ● 释放动画
- #--------------------------------------------------------------------------
- alias eb_sp1_dispose_animation dispose_animation
- def dispose_animation
- eb_sp1_dispose_animation
- @animation_bitmap1 = nil
- @animation_bitmap2 = nil
- end
- #--------------------------------------------------------------------------
- # ● 设置动画活动块
- # frame : 画面数据 (RPG::Animation::Frame)
- #--------------------------------------------------------------------------
- def animation_set_sprites(frame)
- cell_data = frame.cell_data
- for i in 0..15
- sprite = @animation_sprites[i]
- next if sprite == nil
- pattern = cell_data[i, 0]
- if pattern == nil or pattern == -1
- sprite.visible = false
- next
- end
- if pattern < 100
- sprite.bitmap = @animation_bitmap1
- else
- sprite.bitmap = @animation_bitmap2
- end
- sprite.visible = true
- sprite.src_rect.set(pattern % 5 * 192,
- pattern % 100 / 5 * 192, 192, 192)
- position = @animation.position
- if position == 3
- if self.viewport != nil
- sprite.x = self.viewport.rect.width / 2
- sprite.y = self.viewport.rect.height / 2
- else
- sprite.x = 272
- sprite.y = 208
- 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 / 2 if position == 0
- sprite.y += self.src_rect.height / 2 if position == 2
- end
- if @animation_mirror
- sprite.x -= cell_data[i, 1]
- sprite.y += cell_data[i, 2]
- sprite.angle = (360 - cell_data[i, 4])
- sprite.mirror = (cell_data[i, 5] == 0)
- else
- sprite.x += cell_data[i, 1]
- sprite.y += cell_data[i, 2]
- sprite.angle = cell_data[i, 4]
- sprite.mirror = (cell_data[i, 5] == 1)
- end
- sprite.z = self.z + 300 + i
- 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.opacity = cell_data[i, 6] * self.opacity / 255.0
- sprite.blend_type = cell_data[i, 7]
- end
- end
-
- def x=(x)
- sx = x - self.x
- if sx != 0
- if @animation_sprites != nil
- for i in 0..15
- @animation_sprites[i].x += sx
- end
- end
- end
- super
- end
-
- def y=(y)
- sy = y - self.y
- if sy != 0
- if @animation_sprites != nil
- for i in 0..15
- @animation_sprites[i].y += sy
- end
- end
- end
- super
- end
- end
复制代码 我也出现过这样的问题,用这个就好了。 |
|