mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-03 12:28:03 +08:00
Liniting and deprecating old animation widget way
This commit is contained in:
@ -153,6 +153,8 @@ class Util {
|
|||||||
/// This actually creates an [EmbeddedGameWidget] with a [SimpleGame] whose only content is an [AnimationComponent] created from the provided [animation].
|
/// This actually creates an [EmbeddedGameWidget] with a [SimpleGame] whose only content is an [AnimationComponent] created from the provided [animation].
|
||||||
/// You can use this implementation as base to easily create your own widgets based on more complex games.
|
/// You can use this implementation as base to easily create your own widgets based on more complex games.
|
||||||
/// This is intended to be used by non-game apps that want to add a sprite sheet animation.
|
/// This is intended to be used by non-game apps that want to add a sprite sheet animation.
|
||||||
|
///
|
||||||
|
/// @Deprecated('Use FlameSpriteAnimation instead')
|
||||||
widgets.Widget animationAsWidget(Position size, Animation animation) {
|
widgets.Widget animationAsWidget(Position size, Animation animation) {
|
||||||
return EmbeddedGameWidget(
|
return EmbeddedGameWidget(
|
||||||
BaseGame()..add(AnimationComponent(size.x, size.y, animation)),
|
BaseGame()..add(AnimationComponent(size.x, size.y, animation)),
|
||||||
|
|||||||
@ -64,7 +64,7 @@ class _FlameAnimationWidget extends State<FlameAnimationWidget>
|
|||||||
_lastUpdated = DateTime.now().millisecond;
|
_lastUpdated = DateTime.now().millisecond;
|
||||||
_controller.repeat(
|
_controller.repeat(
|
||||||
// -/+ 60 fps
|
// -/+ 60 fps
|
||||||
period: Duration(milliseconds: 16));
|
period: const Duration(milliseconds: 16));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user