From 3b7d41945242aac45324f45a23ba6739cb9b15da Mon Sep 17 00:00:00 2001 From: Nathan Sweet Date: Sun, 20 Jun 2021 18:53:56 -0400 Subject: [PATCH] [ts] Player, added config.frame. --- spine-ts/player/src/Player.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spine-ts/player/src/Player.ts b/spine-ts/player/src/Player.ts index 4ca95ff1e..ef9da37ad 100644 --- a/spine-ts/player/src/Player.ts +++ b/spine-ts/player/src/Player.ts @@ -140,6 +140,9 @@ module spine { /* Optional: Callback when the skeleton could not be loaded or rendered. Default: none */ error: (player: SpinePlayer, msg: string) => void + /* Optional: Callback at the start of each frame, before the skeleton is posed or drawn. Default: none */ + frame: (player: SpinePlayer) => void + /* Optional: Callback just after the skeleton is posed each frame. Default: none */ update: (player: SpinePlayer) => void @@ -719,6 +722,8 @@ module spine { let renderer = this.sceneRenderer; renderer.resize(webgl.ResizeMode.Expand); + if (config.frame) config.frame(this); + // Update animation time and pose the skeleton. if (!this.paused) { this.time.update();