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

Ability to modify Sprite ticks per frame on runtime #26

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/sprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class Sprite extends Component {
}

componentWillReceiveProps(nextProps) {
if (nextProps.state !== this.props.state) {
if (nextProps.state !== this.props.state || nextProps.ticksPerFrame !== this.props.ticksPerFrame) {
this.finished = false;
this.props.onPlayStateChanged(1);
this.context.loop.unsubscribe(this.loopID);
Expand Down
2 changes: 1 addition & 1 deletion src/native/components/sprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default class Sprite extends Component {
}

componentWillReceiveProps(nextProps) {
if (nextProps.state !== this.props.state) {
if (nextProps.state !== this.props.state || nextProps.ticksPerFrame !== this.props.ticksPerFrame) {
this.finished = false;
this.props.onPlayStateChanged(1);
this.context.loop.unsubscribe(this.loopID);
Expand Down