Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit 3f6fb85

Browse files
committed
Ability to modify Sprite ticks per frame on runtime
1 parent 25cf0b7 commit 3f6fb85

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/components/sprite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default class Sprite extends Component {
5252
}
5353

5454
componentWillReceiveProps(nextProps) {
55-
if (nextProps.state !== this.props.state) {
55+
if (nextProps.state !== this.props.state || nextProps.ticksPerFrame !== this.props.ticksPerFrame) {
5656
this.finished = false;
5757
this.props.onPlayStateChanged(1);
5858
this.context.loop.unsubscribe(this.loopID);

src/native/components/sprite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default class Sprite extends Component {
5454
}
5555

5656
componentWillReceiveProps(nextProps) {
57-
if (nextProps.state !== this.props.state) {
57+
if (nextProps.state !== this.props.state || nextProps.ticksPerFrame !== this.props.ticksPerFrame) {
5858
this.finished = false;
5959
this.props.onPlayStateChanged(1);
6060
this.context.loop.unsubscribe(this.loopID);

0 commit comments

Comments
 (0)