From d9e36d2bc3e2ea24820f6e8cd5e82ab3a5e30387 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Mon, 3 Oct 2022 14:57:31 +1100 Subject: [PATCH] Add reverse animation --- lib/filament_controller.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/filament_controller.dart b/lib/filament_controller.dart index ab7f9b37..fe80aa2d 100644 --- a/lib/filament_controller.dart +++ b/lib/filament_controller.dart @@ -16,7 +16,7 @@ abstract class FilamentController { Future setFrameRate(int framerate); Future setRendering(bool render); Future render(); - + void setPixelRatio(double ratio); Future resize(int width, int height, { double contentScaleFactor=1}); Future setBackgroundImage(String path); Future setBackgroundImagePosition(double x, double y, {bool clamp=false}); @@ -52,9 +52,9 @@ abstract class FilamentController { Future> getAnimationNames(FilamentAsset asset); Future removeAsset(FilamentAsset asset); Future clearAssets(); - Future playAnimation(FilamentAsset asset, int index, {bool loop = false}); + Future playAnimation(FilamentAsset asset, int index, {bool loop = false, bool reverse=false}); Future playAnimations(FilamentAsset asset, List indices, - {bool loop = false}); + {bool loop = false, bool reverse=false}); Future stopAnimation(FilamentAsset asset, int index); Future setCamera(FilamentAsset asset, String name); Future setTexture(FilamentAsset asset, String assetPath, @@ -270,14 +270,14 @@ class PolyvoxFilamentController extends FilamentController { } Future playAnimation(FilamentAsset asset, int index, - {bool loop = false}) async { - await _channel.invokeMethod("playAnimation", [asset, index, loop]); + {bool loop = false, bool reverse=false}) async { + await _channel.invokeMethod("playAnimation", [asset, index, loop, reverse]); } Future playAnimations(FilamentAsset asset, List indices, - {bool loop = false}) async { + {bool loop = false, bool reverse=false}) async { return Future.wait(indices.map((index) { - return _channel.invokeMethod("playAnimation", [asset, index, loop]); + return _channel.invokeMethod("playAnimation", [asset, index, loop, reverse]); })); }