add setAnimationFrame

This commit is contained in:
Nick Fisher
2023-02-26 12:21:36 +08:00
parent 20747f5cc8
commit 19f2d99ded
6 changed files with 26 additions and 3 deletions

View File

@@ -70,6 +70,8 @@ abstract class FilamentController {
Future<List<String>> getAnimationNames(FilamentAsset asset);
Future removeAsset(FilamentAsset asset);
Future clearAssets();
Future setAnimationFrame(
FilamentAsset asset, int animationIndex, int animationFrame);
Future playAnimation(FilamentAsset asset, int index,
{bool loop = false, bool reverse = false});
Future playAnimations(FilamentAsset asset, List<int> indices,
@@ -332,6 +334,12 @@ class PolyvoxFilamentController extends FilamentController {
await _channel.invokeMethod("playAnimation", [asset, index, loop, reverse]);
}
Future setAnimationFrame(
FilamentAsset asset, int index, int animationFrame) async {
await _channel
.invokeMethod("setAnimationFrame", [asset, index, animationFrame]);
}
Future playAnimations(FilamentAsset asset, List<int> indices,
{bool loop = false, bool reverse = false}) async {
return Future.wait(indices.map((index) {