mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-19 06:29:15 +08:00
847 B
847 B
MoveEffect
Applied to PositionComponents, this effect can be used to move the component to a new position, using an animation curve.
Usage example:
import 'package:flame/effects/effects.dart';
// Square is a PositionComponent
square.addEffect(MoveEffect(
destination: Position(200, 200),
speed: 250.0,
curve: Curves.bounceInOut,
));
ScaleEffect
Applied to PositionComponents, this effect can be used to change the width and height of the component, using an animation curve.
Usage example:
import 'package:flame/effects/effects.dart';
// Square is a PositionComponent
square.addEffect(ScaleEffect(
size: Size(300, 300),
speed: 250.0,
curve: Curves.bounceInOut,
));