From 531f3c58031ac785a29fe4a67c173e4ee574a94e Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 23 Jun 2019 14:25:02 +0200 Subject: [PATCH] feat(assets): add more wrapper around animator functions in Sprite --- CHANGELOG.md | 1 + gamecore/modules/assets/sprites.lua | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53471b9..c07f35d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **assets:** Add a way to get current relative frame +- **assets:** Add more wrapper around animator functions in Sprite ### Changed diff --git a/gamecore/modules/assets/sprites.lua b/gamecore/modules/assets/sprites.lua index 63676a2..052f3f2 100644 --- a/gamecore/modules/assets/sprites.lua +++ b/gamecore/modules/assets/sprites.lua @@ -74,6 +74,14 @@ function Sprite:getDimensions() return self.tileset:getDimensions() end +function Sprite:getFrame() + return self.animator:getFrame() +end + +function Sprite:getAnimationDuration(animation) + return self.animator:getAnimationDuration(animation) +end + function Sprite:getRelativeFrame() return self.animator:getRelativeFrame() end