Skip to content

Commit

Permalink
feat: FrameData now supports offsets, closes #1181
Browse files Browse the repository at this point in the history
  • Loading branch information
AlmasB committed Jul 11, 2022
1 parent 9d5fe3a commit 6cba0b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ class AnimatedTexture(defaultChannel: AnimationChannel) : Texture(defaultChannel
fitWidth = frameData.width.toDouble()
fitHeight = frameData.height.toDouble()
viewport = frameData.viewport

layoutX = frameData.offsetX.toDouble()
layoutY = frameData.offsetY.toDouble()
}

private fun updateAnimation() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,7 @@ data class FrameData(
val height: Int
) {
val viewport = Rectangle2D(x.toDouble(), y.toDouble(), width.toDouble(), height.toDouble())

var offsetX = 0
var offsetY = 0
}

0 comments on commit 6cba0b4

Please sign in to comment.