Anim Editor: added FoeFlip property, Space to play, S to swap sides, P to show/hide property lines for selected particle

This commit is contained in:
Maruno17
2024-04-18 22:35:15 +01:00
parent 15033d6114
commit 4480def33c
23 changed files with 264 additions and 161 deletions

View File

@@ -124,6 +124,7 @@ class AnimationPlayer
if relative_to_index >= 0 && relative_to_index.odd? && particle[:focus] != :user_and_target
particle_sprite.foe_invert_x = particle[:foe_invert_x]
particle_sprite.foe_invert_y = particle[:foe_invert_y]
particle_sprite.foe_flip = particle[:foe_flip]
end
# Find earliest command and add a "make visible" command then
if sprite && !particle_sprite.battler_sprite?
@@ -231,7 +232,7 @@ class AnimationPlayer
# Update all particles/sprites
@anim_sprites.each { |particle| particle.update(elapsed) }
# Finish or loop the animation
if elapsed >= @duration
if elapsed >= @duration * @slowdown
if looping
@need_reset = true
else

View File

@@ -5,7 +5,7 @@
class AnimationPlayer::ParticleSprite
attr_accessor :sprite
attr_accessor :focus_xy, :offset_xy, :focus_z
attr_accessor :foe_invert_x, :foe_invert_y
attr_accessor :foe_invert_x, :foe_invert_y, :foe_flip
FRAMES_PER_SECOND = 20.0
@@ -97,7 +97,9 @@ class AnimationPlayer::ParticleSprite
case property
when :frame then @sprite.src_rect.x = value.floor * @sprite.src_rect.width
when :blending then @sprite.blend_type = value
when :flip then @sprite.mirror = value
when :flip
@sprite.mirror = value
@sprite.mirror = !@sprite.mirror if @foe_flip
when :x
value = value.round
value *= -1 if @foe_invert_x